Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Primary Key contain a NULL??

Author  Topic 

p.shaw3@ukonline.co.uk
Posting Yak Master

103 Posts

Posted - 2007-07-13 : 12:32:35
Is there any way, under any circumstance, that a primary key can contain one NULL?

karuna
Aged Yak Warrior

582 Posts

Posted - 2007-07-13 : 12:33:41
No, A primary key cannot have NULL, but an unique key can have 1 NULL.

Thanks
Karunakaran
Go to Top of Page

p.shaw3@ukonline.co.uk
Posting Yak Master

103 Posts

Posted - 2007-07-13 : 12:34:23
Thanks.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-07-13 : 14:10:48
Ah yes, but you can write a hack to do this

This will do what you want

http://weblogs.sqlteam.com/brettk/archive/2005/04/20/4592.aspx

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

p.shaw3@ukonline.co.uk
Posting Yak Master

103 Posts

Posted - 2007-07-14 : 07:55:42
Thanks Brett. That's a very interesting article.
Go to Top of Page
   

- Advertisement -