resetting IDENTITY after CREATE TABLE

From: Greg Shaw (greg_at_nospam.com.au)
Date: 05/09/04


Date: Sun, 09 May 2004 22:53:56 GMT

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.



Relevant Pages

  • Re: How can I get the release number?
    ... > Their documentation says 5.80, but a script I borrowed says that ... The old version numbering system goes revision ... -- James "Kibo" Parry ...
    (comp.lang.perl.misc)
  • [NEWS] IBM Informix Web DataBlade Local Root by Design
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... that ease development of "intelligent", interactive, Web-enabled database ... person who has access to change the Perl script. ...
    (Securiteam)
  • RE: Need some MySQL query help...
    ... attempting to run the script: ... passed to the database. ... passwd entry to the current database entry. ...
    (perl.dbi.users)
  • Re: Function that returns date of file.
    ... string after the date/time when it is used by itself. ... Is that your entire script? ... I make an IF statement that required the 'equals equals'. ... designed database your job will be all that much harder. ...
    (alt.php)
  • Re: script dies yet there are no errors in error log
    ... It might be better to ensure the case of the entries in the database, ... This kind of error usually is caused by a CGI or PHP failing to ... input could not be more simple, just a bunch of UPC codes, one per line: ... Given 15 such numbers, the script does fine. ...
    (comp.lang.php)

Loading