?
Solved

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

Posted on 2013-06-13
2
Medium Priority
?
342 Views
Last Modified: 2013-06-14
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
Comment
Question by:MediaBanc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Assisted Solution

by:Racim BOUDJAKDJI
Racim BOUDJAKDJI earned 1000 total points
ID: 39246944
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
 
LVL 2

Accepted Solution

by:
vivekkumarSharma earned 1000 total points
ID: 39247224
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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question