Follow sqlserver-dba.com

Subscribe to RSS feed  Follow @jackvamvas - Twitter

*Use the Comments section for questions

SQLServer-DBA.com Links

Dba_db2_button

dba-ninja.com

SQL Server DBA Jobs

How to find SQL Filtered Indexes

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

Find SQL Server LOB Columns

How to List all indexes of all SQL tables


Author: Tom Collins (http://www.sqlserver-dba.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

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.

Working...

Post a comment on How to find SQL Filtered Indexes


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer