Search code examples
sql-serverdatabaseindexingfiltered-index

SQL Server 2008 R2 filtered index


Is there any way to investigate what I haven't used as a value during creating filtered index? I have looked at index create script but still no value.

create nonclustered index IX1 where status=0

I am looking for the status column and 0 value in below query


Solution

  • The built-in system catalog view sys.indexes has the filter information in the filter_definition column:

    select
        o.name as [Table],
        i.name as [Index],
        i.filter_definition as [Filter]
    from sys.objects o
    inner join sys.indexes i on i.object_id = o.object_id
    where i.name = 'IX1'