user2941762
user2941762

Reputation: 61

Multiple conditions on filtered index in sql server?

can we create filter index on multiple where conditions?

Upvotes: 1

Views: 630

Answers (1)

sstan
sstan

Reputation: 36483

Yes. Example:

create table TestTable (
  id int identity primary key,
  a varchar(50),
  b varchar(50)
)

create nonclustered index TestTableFilteredIndex 
on TestTable (b)
where id > 100 
  and a is not null

SQLFiddle

More information on filtered indexes.

Upvotes: 3

Related Questions