06 April,2023 by Tom Collins
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
How to List all indexes of all SQL tables
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |