February 13, 2013 at 9:09 am
Is it possible to use the INCLUDE option on a Primary Key? If so, what is the syntax? I can't seem to locate it.
Thanks
February 13, 2013 at 9:22 am
To my knowledge you cant even if the PK is nonclustered.
_________________________________________________________________________
SSC Guide to Posting and Best Practices
February 13, 2013 at 9:23 am
I was afraid of that..thanks.
February 13, 2013 at 9:25 am
Constraints can't have includes or filters, that's pk or unique constraints.
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
February 13, 2013 at 9:51 am
Go ahead, Gail, shatter my dreams. 🙂
February 13, 2013 at 12:42 pm
A unique index where all key columns are non-null will achieve effectively the same thing as having a nonclustered PK on those same key columns plus you can add your included columns. However that may not satisfy some things like transactional replication requirements. Just a thought though in case you needed an option.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply