View

  • We are currently using SQL Server 2000. I am trying to create a index on a view but it gives me the below error "Cannot create index on view 'PAA_Inv_DE_Transactions' because the view is not schema bound."

    Does any one has any idea about it? I know this can work in 2008 but I really need in 2000.

    Thanks,

    Aman

  • Your view has not been created with schema binding. Here is the books online for create view, look at the scemabinding option.

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • Thanks for your reply. I have created a View as per your suggestion in schema binding. below is the code

    ALTER VIEW PAA

    With schemabinding

    AS

    SELECT

    L_FUNDID,

    L_trntype,

    L_trndate,

    L_description

    FROM

    DBO.PAA_ViewPostion

    GROUP BY

    However when I create an index on l_fundid (clustered) it gives me an error.

    Server: Msg 1941, Level 16, State 1, Line 1

    Nonunique clustered index cannot be created on view 'PAA' because only unique clustered indexes are allowed.

    Can you please advice?

    --Aman

  • I would think that you are getting this error because the column you are trying to create a clustered index on (l_fundid) is not unique. http://msdn.microsoft.com/en-us/library/aa258260%28v=sql.80%29.aspx. You must have at least one unique clustered index.

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply