|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
copy a db, identity problemi need to copy a db to another db every single table to another similar to the first one but with some difference. When i try to do that i need to remove some constraint and all the identity on the new db. i'd like do that with a script, i tried: CREATE TABLE ( id int IDENTITY (1,1) NOT NULL ) ALTER TABLE prova ALTER COLUMN id int null GO it doesnt work. how can i remove identity from a column of my table?? tx carlo >> how can i remove identity from a column of my table?? You cannot do this directly. The alternative is to create another table, copy the data & rename it. The EM interface can get this done with a few mouse clicks and it may perform reasonably for small-medium sized tables. -- Anith You can't directly remove the IDENTITY property. You would have to
create a new column or new version of the table. However, you can use the SET IDENTITY_INSERT option to allow you to populate the column without removing the IDENTITY property. See Books Online for details. -- David Portas SQL Server MVP -- |
|||||||||||||||||||||||