How to add Primary Key

Last Post 19 Sep 2007 11:40 AM by nathankatcgfdotorg. 1 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
nathankatcgfdotorg
New Member
New Member

--
19 Sep 2007 09:12 AM
Hi. I'd like to add a primary key constraint to an already existing column [ID]. Using books online's guide I can't seem to do it using Alter Table or Alter Column. This will be run from an sp so I can't do it in Enterprise Manager. I can do it if I add the column to the table at the same time but I don't want to do it at the same time because I want it to run as fast as possible. I figure it will run faster separately however I'll have to test that theory.

The reason I don't want to do it at the same time is because I am getting time out errors in the asp page (Server.ScriptTimeout = 3000) and so am having to break up the manipulation of the table creation and filling etc into separate steps. Table has 600K records. Two fields: [ID] int and Col001 Varchar(2000).

Thanks for any help you can provide.
nathankatcgfdotorg
New Member
New Member

--
19 Sep 2007 11:40 AM
Thanks!
You are not authorized to post a reply.

Acceptable Use Policy