We have a table that has an identity property associated to a column ? How
can we drop it ?Disclaimer: Get a good backup before you start mucking around with the
schema.
Probably have to create a new INT column, UPDATE it:
UPDATE Table1
SET NewCol = OldIdentityCol
Then use ALTER TABLE to drop OldIdentityCol. You'll also need to Drop and
Rebuild any constraints, etc.
If you use EM to change the Identity property of the table, it does
something similar - except that it creates the entire table again and should
preserve any constraints for you.
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:OcXYlz3UFHA.544@.TK2MSFTNGP15.phx.gbl...
> We have a table that has an identity property associated to a column ? How
> can we drop it ?
>|||Hi,
There is no direct command in SQL Server to drop the Identity property in a
table. You may need to drop and recreate the table with no identity.
Thanks
Hari
SQL Server MVP
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:OcXYlz3UFHA.544@.TK2MSFTNGP15.phx.gbl...
> We have a table that has an identity property associated to a column ? How
> can we drop it ?
>
No comments:
Post a Comment