Nika Javakhishvili
Nika Javakhishvili

Reputation: 462

SQL Server : change primary key to identity

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

Upvotes: 1

Views: 1955

Answers (3)

Rahul Tripathi
Rahul Tripathi

Reputation: 172408

You can try

Options -> Designers -> Table and Database Designers

Check "Auto generate change scripts"

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

Upvotes: 2

Lukasz Szozda
Lukasz Szozda

Reputation: 175606

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

Upvotes: 1

Thomas
Thomas

Reputation: 2984

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.

Upvotes: 4

Related Questions