Index on View having some repeated rows in sql server 2008r2

  • Hi,

    Please let me know how to create index on view when view have some repeated rows, i tried to use distinct inside view but it is not supported.

    Scenario :-

    My Select query fetches result from multiple tables by inner join due to which some rows repeated due to that i was unable to create index on view

    Thanks in Advance.

  • Without knowing your schema or the data contained within it is impossible to help, maybe you could provide DDL's and sample data and I'm sure you will get an answer.

    In the meantime all I can suggest is to re-write the query so that there are no duplicates?

    Andy

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • Why do you want an indexed view anyway?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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