Friday, March 9, 2012

Possible to drop IDENTITY from a column?

I have several tables with the IDENTITY attribute (my problem now!) and I
need to remove the IDENTITY attribute from some of those tables/columns. Is
there a sane way of doing it? If so, could you share it with me?
Thanks!
MichaelUnfortumately not.
"Snake" <Snake@.discussions.microsoft.com> wrote in message
news:46DDBEBD-8F2D-41D9-922B-59FF098E88A2@.microsoft.com...
>I have several tables with the IDENTITY attribute (my problem now!) and I
> need to remove the IDENTITY attribute from some of those tables/columns.
> Is
> there a sane way of doing it? If so, could you share it with me?
> Thanks!
> Michael|||Not easy. You could create a new column, populate it with the old data from
the IDENTITY column then change any referencing indexes, constraints, etc
and drop the old column.
Alternatively, if you remove the IDENTITY property using Enterprise
Manager's table designer it will drop and re-create the table for you. Not
something you want to do while the system is in use though.
David Portas
SQL Server MVP
--|||Really not easy, Itzik wrote an article about that, where you can find the
information from behind the scenes:
http://www.windowsitpro.com/Article...22080.html?Ad=1
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Snake" <Snake@.discussions.microsoft.com> schrieb im Newsbeitrag
news:46DDBEBD-8F2D-41D9-922B-59FF098E88A2@.microsoft.com...
>I have several tables with the IDENTITY attribute (my problem now!) and I
> need to remove the IDENTITY attribute from some of those tables/columns.
> Is
> there a sane way of doing it? If so, could you share it with me?
> Thanks!
> Michael

No comments:

Post a Comment