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 2008 Forums
 Transact-SQL (2008)
 How to add the primarey key on existing table

Author  Topic 

sandeep1209
Starting Member

6 Posts

Posted - 2012-03-08 : 03:15:16
Hi Friends,

create table pkcon (id int,name varchar(20))
-- here i'm trying to add the primarey key constraint
alter table pkcon add primary key(id)

any buddy tell me how to add the primarey key constraint in existing table

sandeep

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2012-03-08 : 06:23:56
Go look in Books Online, under ALTER TABLE, for the syntax to add a primary key constraint

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -