IF EXISTS (SELECT job_id FROM msdb.dbo.sysjobs_view WHERE name = N'Daily Index Defrag') EXEC msdb.dbo.sp_delete_job @job_name=N'Daily Index Defrag', @delete_unused ...
from sys.dm_db_index_physical_stats(DB_ID(),NULL,NULL,NULL,'LIMITED') as ips -- yes inner join sys.indexes as ind on ips.index_id = ind.index_id and ips.object_id = ind.object_id -- yes inner join sys ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results