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 2000 Forums
 Transact-SQL (2000)
 Primary Key vs. Unique Index

Author  Topic 

jpham
Starting Member

19 Posts

Posted - 2006-07-27 : 12:39:32
Hi All,
What is the major differences between primary key and
unique indexes.
Thanks,
Jodie

nr
SQLTeam MVY

12543 Posts

Posted - 2006-07-27 : 12:41:46
A PK defaults to clustered if there is no clustered index already on the table.
A PK cannot contain nullable columns.
A PK is held as part of the table definition.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-07-28 : 04:14:41
one more thing...

There can only be one PK whereas there can be many unique indexes..

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-07-28 : 04:57:54


So ... the PK is unique among indexes? !!

Kristen
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-07-28 : 05:36:05
quote:
Originally posted by Kristen



So ... the PK is unique among indexes? !!

Kristen



Yeah..I guess so !

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page
   

- Advertisement -