1

I am trying to change my primary key to identity(1, 1) but SQL Server says:

Saving changes is not permitted. Tables to be dropped and re-created.

Is there any other solution to achieve my goal? P.S I don't have permission to access tools...

enter image description here

8
  • Show your code. Do you use Designer/SQL? Commented Nov 12, 2015 at 10:21
  • I am using ms sql table design template. Commented Nov 12, 2015 at 10:22
  • 1
    Possible duplicate of How to set identity column to created table in SQL server Commented Nov 12, 2015 at 10:22
  • @a_horse_with_no_name no the problem he mentions is one with the management design studio. Had that myself once. So Would say not a duplicate of that one Commented Nov 12, 2015 at 10:24
  • 1
    Btw @NikaJavakhishvili if you REALLY have the management console installed on the production server you should talk with the admin.....that is normally not even remotely necessary. Normally it is so that you have the conosle locally and just CONNECT to the production server via them Commented Nov 12, 2015 at 10:35

3 Answers 3

4

In the management studio:

Tools->options->Designers->Table and database designers. There under table options is the point "Prevent saving changes that require table re-creation". Uncheck this and it should work. 
Sign up to request clarification or add additional context in comments.

12 Comments

ok that is unusual as tools options in the management studio defines your keyboard settings, .... never heard of a case where you can't access it thus.
It's on production server , and i need some changes
@NikaJavakhishvili:- You have management studio installed on Production server? :O
@NikaJavakhishvili If you mean when you connect to the production server you still want it then that will be so this way. The main point is that the tools->optiosn are settings for the user that is currently logged into windows and has nothing to do with how you connect to the databaes or to which you connect. They are just the settings for the editor.
@NikaJavakhishvili no. Its all or nothing. You can see it so this setting is just a security feature that prevents users from making specific types of changes when they use the management console. It does NOT prevent the same things done via sql commands though. So it is just a help for more inexperienced users. Thus if you know what you are doing (changing indexes, changing existing columns, ....) then you are absolutely fine with that unchecked.
|
2

You can try

Options -> Designers -> Table and Database Designers

Check "Auto generate change scripts"

Uncheck "Prevent saving changes that require table re-creation".

Comments

1

Save (Not Permitted) Dialog Box

To change this option, on the Tools menu, click Options, expand Designers, and then click Table and Database Designers. Select or clear the Prevent saving changes that require the table to be re-created check box.

enter image description here

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.