December 12, 2007 at 8:32 am
I have been having trouble locating the answer to a question. When I add a Unique Constraint to a field on a table, does that automatically create a Non Clustered Index on that field?
Thanks
December 12, 2007 at 8:38 am
meichner (12/12/2007)
I have been having trouble locating the answer to a question. When I add a Unique Constraint to a field on a table, does that automatically create a Non Clustered Index on that field?Thanks
Yes, at least in SQL Server 2000 and 2005. I cannot speak for earlier versions or other flavors of SQL, but in those two at least a unique constraint is enforced by creating a unique index. There is a reference at http://msdn2.microsoft.com/en-us/library/ms177420.aspx
Edited to add the url tag I forgot the first time.
---
Timothy A Wiseman
SQL Blog: http://timothyawiseman.wordpress.com/
December 12, 2007 at 8:49 am
Thanks for the fast response.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy