8 Ağustos 2016 Pazartesi

MS-SQL / db index list

USE DB_NAME
GO
SELECT DB_NAME() AS Database_Name
, sc.name AS Schema_Name
, o.name AS Table_Name
, i.name AS Index_Name
, i.type_desc AS Index_Type
FROM sys.indexes i
INNER JOIN sys.objects o ON i.object_id = o.object_id
INNER JOIN sys.schemas sc ON o.schema_id = sc.schema_id
WHERE i.name IS NOT NULL
AND o.type = 'U'
ORDER BY Index_Name, i.type

Hiç yorum yok:

Yorum Gönder

Problem MS SQL Server instances disappear from SQL Intelligent Policy and previously discovered Availability Groups (AG) in NetBackup. Cause...