Disable Primary Key and Re-Enable After SQL Bulk Insert

Posted by Jon on Stack Overflow See other posts from Stack Overflow or by Jon
Published on 2010-06-01T10:49:10Z Indexed on 2010/06/01 10:53 UTC
Read the original article Hit count: 215

I am about to run a massive data insert into my DB. I have managed to work out how to enable and rebuild non-clustered indexes on my tables but I also want to disable/enable primary keys.

You can't disable the clustered index for the primary key as the table is inaccessible when that is done and my attempt to do a ALTER TABLE for constraints does not work as I think that is only for foreign keys.

Do you know of a way to Disable the Primary Key and Re-Enable After SQL Bulk Insert.

NOTE: This is over numerous tables and so I don't know the exact primary key specifications eg/name etc

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server-2005