Solved

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

Posted on 2013-06-13
2
338 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 250 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 250 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

734 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