1

enter image description hereI have table "Categories" where primary key is "categoryId". Initially, I made a mistake and did not set identity specification to 'yes'. now I have other tables where 'categoryId' is using as foreign key. I have to identity specification to 'yes' but SQL Server 2005 is not allowing me.

Is there any other option to set it 'yes' except create script for whole database and then make new 'Categories' table?

I also tried to remove primary key from this column but then its saying me that child tables will be deleted.

I tried this one also but its not upto my request.

Community
  • 1
  • 1
Sohail
  • 574
  • 3
  • 21

2 Answers2

0

try this . go to sql server management studio then : tools -> options -> designers -> Prevent saving changes that require table re-creation (uncheck this )

after this try again to set identity column

Besher
  • 550
  • 3
  • 8
  • 29
0

If loosing data is no problem means you can retry it by deleting data from your table.

Govan
  • 7,751
  • 5
  • 26
  • 42