﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Backups / SQL Server 7,2000  / Identity insertion and updation / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 25 May 2013 18:17:03 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Identity insertion and updation</title><link>http://www.sqlservercentral.com/Forums/Topic434683-24-1.aspx</link><description>Oops  I just realized that this is quite old thread.  I am not sure why it suddenly came into my screen.</description><pubDate>Sun, 24 Jan 2010 23:50:54 GMT</pubDate><dc:creator>G.R.Prithiviraj Kulasingham</dc:creator></item><item><title>RE: Identity insertion and updation</title><link>http://www.sqlservercentral.com/Forums/Topic434683-24-1.aspx</link><description>Removing identity property is something I have seen many people doing for some reason.Most of the time,  they perform an additional query to get the next value and then pass it. This method creates additional locks and will not work perfectly in a multi user environment. I believe identity is one of the good things SQL Server has. Having said that, there is another way of moving them.  It will work better if you do not have foreign keys defined against this table and this table is large. As of now, it will work only in enterprise edition of SQL Server 2005, but I believe it will work in some additional editions of SQL Server 20081.  Create another table with the same structure except the identity property.2.  Switch the data from old table to new table3.  Drop the old table (which has the identity property)4.  Rename the new table with proper name.In case you have soem foreign keys you need to drop the foreign keys and re-create them.I heard that SQL Server mobile edition has a command where you can simply turn off the identity property, but it is not yet available on other editions.</description><pubDate>Sun, 24 Jan 2010 23:48:35 GMT</pubDate><dc:creator>G.R.Prithiviraj Kulasingham</dc:creator></item><item><title>RE: Identity insertion and updation</title><link>http://www.sqlservercentral.com/Forums/Topic434683-24-1.aspx</link><description>[quote][b]Kishore.P (1/8/2008)[/b][hr]use sp_msforeachtable to drop the identity column in all tables.[/quote]Yup... easy to do if no foreign keys... of course, if these IDENTITY columns are being used as the PK for tables, your whole database becomes a useless piece of slag.C'mon folks!  Doesn't anyone else see a problem with this request??? :blink:</description><pubDate>Tue, 08 Jan 2008 19:05:23 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: Identity insertion and updation</title><link>http://www.sqlservercentral.com/Forums/Topic434683-24-1.aspx</link><description>[quote][b]balaji_rcs (12/24/2007)[/b][hr]Hi,  Thanks for your reply. I want to remove the identity properties in the table totally. i.e I want to remove the identity while update also.[/quote]Yeah, uh-huh... what are you going to use to replace the auto-numbering property of the IDENTITY property?  Sequence table?  Better post that code so we can check it or you'll end up with a bazillion deadlocks per day.  SELECT MAX()?  Again, better post that code so we can make sure that you won't end up with dupe ID's on a high usage system.And, then, you might as well convert all of your code to bloody cursors because you're gonna have a hell of a time inserting more than one row at a time no matter which of those two methods you use.  If you have a third method not offered above, please post it... I want to see what type of knife you're falling on ;)</description><pubDate>Tue, 08 Jan 2008 19:02:50 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: Identity insertion and updation</title><link>http://www.sqlservercentral.com/Forums/Topic434683-24-1.aspx</link><description>I'm a little confused.  Early in the thread it sounded like you want to remove the identity property and retain the data, but your last post sounds like you are okay with dropping the columns with identity property from the tables.Are you ultimately wanting to have 500 tables with no identity columns?Greg</description><pubDate>Tue, 08 Jan 2008 12:13:37 GMT</pubDate><dc:creator>Greg Charles</dc:creator></item><item><title>RE: Identity insertion and updation</title><link>http://www.sqlservercentral.com/Forums/Topic434683-24-1.aspx</link><description>Hi Kishore,  Thanks for your reply. Let me know how to use this procedure for removing the identity column of all tables. And can you tell me about this procedure.</description><pubDate>Tue, 08 Jan 2008 02:37:07 GMT</pubDate><dc:creator>balaji_rcs</dc:creator></item><item><title>RE: Identity insertion and updation</title><link>http://www.sqlservercentral.com/Forums/Topic434683-24-1.aspx</link><description>use sp_msforeachtable to drop the identity column in all tables.</description><pubDate>Tue, 08 Jan 2008 00:25:02 GMT</pubDate><dc:creator>Kishore.P</dc:creator></item><item><title>RE: Identity insertion and updation</title><link>http://www.sqlservercentral.com/Forums/Topic434683-24-1.aspx</link><description>use sp_msforeachtable to drop the identity column in all tables.</description><pubDate>Tue, 08 Jan 2008 00:17:36 GMT</pubDate><dc:creator>Kishore.P</dc:creator></item><item><title>RE: Identity insertion and updation</title><link>http://www.sqlservercentral.com/Forums/Topic434683-24-1.aspx</link><description>Thanks for your reply. I've nearly 700 tables, and more than 500 tables containing identity column and i want to remove the identity property without dropping/creating the table.</description><pubDate>Tue, 08 Jan 2008 00:03:06 GMT</pubDate><dc:creator>balaji_rcs</dc:creator></item><item><title>RE: Identity insertion and updation</title><link>http://www.sqlservercentral.com/Forums/Topic434683-24-1.aspx</link><description>I've just received this article and thought it might also help you :[url]http://www.mssqltips.com/tip.asp?tip=1397[/url]</description><pubDate>Mon, 07 Jan 2008 00:57:12 GMT</pubDate><dc:creator>ALZDBA</dc:creator></item><item><title>RE: Identity insertion and updation</title><link>http://www.sqlservercentral.com/Forums/Topic434683-24-1.aspx</link><description>if you want to completely get rid or the usage of the identity property, you'll have to generate drop/create table statements !!Keep in mind, that there is a purpose for identity ! (automatic increment at insert time.)</description><pubDate>Mon, 24 Dec 2007 01:30:08 GMT</pubDate><dc:creator>ALZDBA</dc:creator></item><item><title>RE: Identity insertion and updation</title><link>http://www.sqlservercentral.com/Forums/Topic434683-24-1.aspx</link><description>Hi,  Thanks for your reply. I want to remove the identity properties in the table totally. i.e I want to remove the identity while update also.</description><pubDate>Mon, 24 Dec 2007 00:25:12 GMT</pubDate><dc:creator>balaji_rcs</dc:creator></item><item><title>RE: Identity insertion and updation</title><link>http://www.sqlservercentral.com/Forums/Topic434683-24-1.aspx</link><description>- Maybe creating a DTS package to load your tables may be the way to go, because it has the option "keep identities"-If using set identity_insert on, keep in mind you have to list all columns in your insert statement. e.g. set identity_insert oninsert into mytable([b]col1,col2,col333,...[/b])select * from mysourcetableset identity_insert offdbcc checkident('mytable')  -- check bol</description><pubDate>Wed, 19 Dec 2007 05:46:15 GMT</pubDate><dc:creator>ALZDBA</dc:creator></item><item><title>RE: Identity insertion and updation</title><link>http://www.sqlservercentral.com/Forums/Topic434683-24-1.aspx</link><description>See SET IDENTITY_INSERT in BOL</description><pubDate>Wed, 19 Dec 2007 04:10:09 GMT</pubDate><dc:creator>Carolyn Richardson</dc:creator></item><item><title>Identity insertion and updation</title><link>http://www.sqlservercentral.com/Forums/Topic434683-24-1.aspx</link><description>I have a lot of tables with identity column. I want to remove the identity properties of all the tables while inserting and updating the tables.</description><pubDate>Wed, 19 Dec 2007 03:30:05 GMT</pubDate><dc:creator>balaji_rcs</dc:creator></item></channel></rss>