Advertisement
Guest User

unique index

a guest
Nov 27th, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.71 KB | None | 0 0
  1. //I tried 4 version OF this code:
  2. CREATE UNIQUE NONCLUSTERED INDEX [BidContractNumber_UNIQUE]
  3. ON [biddetails] (BidContractNumber) WHERE [biddetails].[BidContractNumber] IS NOT NULL;
  4.  
  5. CREATE UNIQUE NONCLUSTERED INDEX [BidContractNumber_UNIQUE]
  6. ON [biddetails] (BidContractNumber) WHERE NOT((BidContractNumber) IS NULL);
  7.  
  8. CREATE UNIQUE INDEX BidContractNumber_UNIQUE
  9. ON biddetails (BidContractNumber) WHERE [BidContractNumber] IS NOT NULL;
  10.  
  11. CREATE UNIQUE INDEX BidContractNumber_UNIQUE
  12. ON biddetails (BidContractNumber) WHERE [BidContractNumber] IS NOT NULL;
  13.  
  14. /*
  15. But I'm getting this error :
  16.  
  17. Msg 156, Level 15, State 1, Line 2
  18. Incorrect syntax near the keyword 'WHERE'.
  19.  
  20. I'm using sql server 2005
  21. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement