Quantcast
Channel: SQL Server DBA
Viewing all articles
Browse latest Browse all 80

How to find SQL Filtered Indexes

$
0
0

Question: How can I find SQL Server Filtered Indexes  ?   We are woking on some migrations  from SQL Server to other engine platform and part of the process includes locating a range of database objects . The identified objects will be recoded into the target engine plaform 

Answer: This script returns a list of Indexes using the filtered index element.

SELECT sch.[Name] as SchemaName
,tbl.[Name] as TableName
,idx.[Name] as IndexName
,idx.[type_desc] as IndexType
,idx.filter_definition as IndexFilterDefinition
FROM sys.indexes idx 
INNER JOIN sys.tables tbl ON tbl.object_id = idx.object_id 
INNER JOIN sys.schemas sch ON sch.schema_id = tbl.schema_id 
WHERE tbl.type_desc = N'USER_TABLE'
AND idx.has_filter = 1 

Read more on finding other SQL Server objects

List Foreign Keys referencing tables in SQL Server

What are the triggers in SQL Server

How to find all identity columns in SQL Server

How to find default values of all SQL Server columns

How to find computed columns on a SQL Server table

Find SQL Server LOB Columns

How to List all indexes of all SQL tables


Viewing all articles
Browse latest Browse all 80

Trending Articles