• --this would be your original source table

    IF OBJECT_ID('tempdb..#SourceTable') IS NOT NULL

    DROP TABLE #SourceTable

    CREATE TABLE #SourceTable (

    [ID] INT IDENTITY(1,1) NOT NULL,

    [Name] NVARCHAR(50) NULL,

    PRIMARY KEY (ID))

    SET IDENTITY_INSERT #SourceTable ON

    INSERT INTO #SourceTable (ID,Name)

    SELECT 110001,'J''s Dream'

    UNION

    SELECT 110003,'FPAB'

    UNION

    SELECT 110009,'Jharna Dhara'

    SET IDENTITY_INSERT #SourceTable OFF

    --this returns your original data

    SELECT * FROM #SourceTable

    If you are converting a large amount of data (say more than 100,000 rows) I'd recommend that the target table be a real table and not a temp table. If you have millions of rows you probably want to break the job into batches.

    --create a temp table to hold the data

    --and generate the new IDENTITY sequence

    IF OBJECT_ID('tempdb..#TargetTable') IS NOT NULL

    DROP TABLE #TargetTable

    CREATE TABLE #TargetTable (

    [ID] INT IDENTITY(22004,1) NOT NULL,

    [Name] NVARCHAR(50) NULL,

    PRIMARY KEY (ID))

    INSERT INTO #TargetTable (Name)

    SELECT Name

    FROM #SourceTable

    --delete the old data (make sure you have a backup)

    TRUNCATE TABLE #SourceTable

    --now insert the data with the new ID sequence

    SET IDENTITY_INSERT #SourceTable ON

    INSERT INTO #SourceTable (ID,Name)

    SELECT ID,Name

    FROM #TargetTable

    SET IDENTITY_INSERT #SourceTable OFF

    --this is your transformed data

    SELECT * FROM #SourceTable