Home All Groups Group Topic Archive Search About

Alter Seed value of Identity column

Author
9 Sep 2006 5:42 AM
Prasad
Hi,
    I want to create temporary table, say "a" which has  a column say "col1"
which i wnt to be an identity for which I need to provide a seed value.
    I tried the following
    1. Create a Table with Identity seed,value as (1,1)
    2. Tried to alter the table using "alter table a alter column col1
IDENTITY (500,1)" but this fails saying that "Server: Msg 156, Level 15,
State 1, Line 1 Incorrect syntax near the keyword 'IDENTITY'."

Any idea how to do this
Note: Since it is a temporary table I can't create a dynamic query bcoz the
table will be in tht context and later on will be destroyed (this is wht I
observed, correct me if I am wrong :) )

    TIA

Thnx
P

Author
9 Sep 2006 6:31 AM
Anith Sen
See DBCC CHECKINDENT command in SQL Server Books Online.

--
Anith
Author
9 Sep 2006 9:53 AM
Prasad
Thnx it worked !!!



Show quote
"Anith Sen" <an***@bizdatasolutions.com> wrote in message
news:%231WOwn90GHA.720@TK2MSFTNGP02.phx.gbl...
> See DBCC CHECKINDENT command in SQL Server Books Online.
>
> --
> Anith
>

AddThis Social Bookmark Button