SQL Filtered Index

Posted on 2011-10-13
Last Modified: 2012-05-12
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])
Question by:dastaub
    LVL 9

    Expert Comment

    above both statement works fine,
    which version of sqlserver are you using ?
    LVL 15

    Expert Comment

    Filtered index is supported only in SQL Server 2008 and above.

    Author Comment

    i am using sql 2005
    LVL 15

    Accepted Solution

    You cannot create filtered index in SQL Server 2005. Filtered index is introduced in sql server 2008.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
    Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now