Set the Identity for a colunm keeping its values

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Paul via .NET 247 (anonymous_at_dotnet247.com)
Date: 03/07/05


Date: Mon, 07 Mar 2005 11:19:06 -0800

Hi,

On SQL Server, e.g.: table X, I want to change the status of the column id_x to IDENTITY.
I already have some values for id_x in the table and I want to keep them. How can I change the status and in the same time keep the old values? Or to do an UPDATE, not INSERT, later on id_x assumed that it has already the IDENTITY status. The table is very big and I want to copy it from one place to another where the new table should have a column as IDENTITY but the old values from the old column that was also declared as Identity.

I can use ADO.NET or simply SQL queries on my server.

Thank you in advance

Paul

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>e7jwwXkxIkS7XzxpZ5tN8w==</Id>