Re: resetting IDENTITY after CREATE TABLE

From: Alan (ambradnum_at_hotmail.com)
Date: 05/10/04

  • Next message: graham: "Re: What did I do wrong?"
    Date: 10 May 2004 05:38:00 -0700
    
    

    Greg

    Have a look at dbcc checkident. One of the options is reseed.

    So
    dbcc checkident (table1, reseed, 100) should start the
    identity field for table1 at 100

    Alan

    Greg Shaw <greg@nospam.com.au> wrote in message news:<pan.2004.05.09.22.54.05.667323@nospam.com.au>...
    > I have a script that builds my database including all the IDENTITY
    > columns. In the script I set them to (1,1). I now have the problem
    > where some client sites already have a numbering system in place and
    > need to start the sequence from some arbitrary point. This is before
    > the table has data. We just want to match the new system with their
    > existing numbering sequence.
    >
    > How do I set the IDENTITY seed after I have created the table?
    > Alternatively, How do I automatically generate a script for an
    > arbitrary table so that I can modify the IDENTITY seed and recreate
    > the table without having to do it manually for each table concerned?
    >
    > Also, where is there documentation on the stored procs included with
    > SQLServer. Maybe one of them does the jobs I just can't find it.
    >
    > Thanks, Greg.


  • Next message: graham: "Re: What did I do wrong?"

    Relevant Pages


    Loading