• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 272
  • Last Modified:

SQL Filtered Index

The below filtered index creation errors, the non filtered index, successfully executes.  The error message says:
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'WHERE'.


CREATE NONCLUSTERED INDEX [Idx_Bed0] ON [dbo].[Visit]([Bed]) WHERE [Bed] <> ''


CREATE NONCLUSTERED INDEX [Idx_Bed0] ON [dbo].[Visit]([Bed])
0
dastaub
Asked:
dastaub
  • 2
1 Solution
 
sachinpatil10dCommented:
above both statement works fine,
which version of sqlserver are you using ?
0
 
AnujCommented:
Filtered index is supported only in SQL Server 2008 and above.
0
 
dastaubAuthor Commented:
i am using sql 2005
0
 
AnujCommented:
You cannot create filtered index in SQL Server 2005. Filtered index is introduced in sql server 2008.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now