Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2005
    Posts
    25

    Unanswered: How to change the Identity value

    I have a database table and it has a column called ttt_id which has an identity seed. Now the Id value is 2845746 and if I insert the new record the value would be 2845747. But I want to change that to 2865740 instead of 2845747. How can do that?

    Thanks.

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Check out DBCC CHECKIDENT in BOL. It should give you everything you need.

  3. #3
    Join Date
    Dec 2003
    Posts
    61

    Identity Insert

    -- SET IDENTITY_INSERT to ON.
    SET IDENTITY_INSERT <TableName> ON
    GO

    INSERT INTO <TableName> (<FieldName>) VALUES(2845747)
    GO

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •