Solved

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

Posted on 2014-11-05
5
116 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:dmaclean2
  • 3
5 Comments
 
LVL 45

Expert Comment

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

Accepted Solution

by:
PortletPaul earned 500 total points
Comment Utility
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
Comment Utility
Take care using this approach, suggest you preview the script first
0
 

Author Closing Comment

by:dmaclean2
Comment Utility
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
Comment Utility
Great (and thanks!)

All the best, Paul
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now