Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 344
  • Last Modified:

Add Primary Key (Clustered Index) while database is online MSSQL

Hi Experts!

I would like to ask if is it possible to add primary key to a database that is online and used by production? I haven't tried yet, I'm scared having the database crash.

By the way, I'm using SQL Server 2005 Standard Edition.

Cheers!
0
MediaBanc
Asked:
MediaBanc
2 Solutions
 
Racim BOUDJAKDJIDatabase Architect - Dba - Data ScientistCommented:
I haven't tried yet, I'm scared having the database crash.
Don't worry it won't.  You will simply have a slowdown during the index creation.
0
 
vivekkumarSharmaCommented:
It completely depend on the volume of data into your table you want to add primary Key.

Try to do this during off peak hours.
It will not affect too much, Just a slowdown may be noticed.

Go Ahead, Don't worry. DB will not crash.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now