Solved

Change integer primary key to IDENTIITY(1,1) in SQL Server 2008 R2 Express

Posted on 2014-11-05
5
119 Views
Last Modified: 2014-11-05
My customer has SQL Server 2008 R2 Express installed. One of the tables has a primary key QueueID int NOT NULL
I need to change it to QueueID int NOT NULL IDENTITY(1,1)

When I try to do that in the table designer and click Save, I get the attached error message.
I tested it on my own SQL Server 2012 (not express) and it works fine.

Is there some setting I need to change on the customer's SQL Server to allow the change? Or is it s hard-stop restriction in the Express edition?

Best Regards,
Doug
Can-t-change-tlkpQueue.PNG
Saving changes is not permitted. The changes you have made require the following tables to be droped and re-created. You have either made the changes to a table that can't be re-created or enabled the option Prevent changes that require the table to be re-created.
Can-t-change-tlkpQueue.PNG
0
Comment
Question by:Douglass MacLean
  • 3
5 Comments
 
LVL 47

Expert Comment

by:Vitor Montalvão
ID: 40423435
There's already records in the table?
0
 
LVL 48

Accepted Solution

by:
PortletPaul earned 500 total points
ID: 40423440
go to:: Tools... Options... Designers... Table and Database Designers

Then untick the "prevent saving changes that require table re-creation".
0
 
LVL 48

Expert Comment

by:PortletPaul
ID: 40423445
Take care using this approach, suggest you preview the script first
0
 

Author Closing Comment

by:Douglass MacLean
ID: 40423484
Thanks, That's exactly what I needed. And I agree with being careful:
1. 1've already tested it on my development copy of the live database
2. I'm doing the change at night when no one is on the system and making a DB backup before I do it.

(Belt ad suspenders) :-)
0
 
LVL 48

Expert Comment

by:PortletPaul
ID: 40423507
Great (and thanks!)

All the best, Paul
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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