Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 i can't save primary keys

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2011-01-16 : 15:16:21
i moved my database but lost some primary keys and identity fields

when I want to go back and add them now I get an error

saving changes is not permitted. The changes you have made require the following tables to be dropped and recreated.
You have either made changes to a table that can't be re-created or enabled the option prevent saving changes that require the table to be recreated

Please advise what i can do

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2011-01-16 : 15:38:08
What does DBCC CHECKDB or DBCC CHECKTABLE say?



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-01-16 : 15:39:32
Use T-SQL Alter Table commands instead of the GUI.

How did you move the database?
Go to Top of Page

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2011-01-16 : 15:53:41
There is an option you can change in SSMS that toggles the ability to save changes through the GUI..however, you should really use T-SQL statements like russell said.



Poor planning on your part does not constitute an emergency on my part.
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-01-16 : 15:55:21
It's a setting in the options menu of Management Studio designed to stop you from doing changes that will make a table inaccessible. Add them via a T-SQL script.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -