Solved

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

Posted on 2014-11-05
5
121 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
[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
  • 3
5 Comments
 
LVL 49

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

Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

Question has a verified solution.

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

I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 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