Friday, June 08, 2007

Determining the next identity value for a table

SELECT IDENT_CURRENT('Table1') + IDENT_INCR('Table1')

Also:

DBCC CHECKIDENT ('table_name', NORESEED)

To reseed the identity value:

DBCC CHECKIDENT ('table_name', RESEED, 10000)

2 Comments:

Blogger navi said...

Thanks for this Query,

Can we use this query with MySql.

Feejaz

1:08 AM  
Blogger Andrew said...

No, this will only work with SQL Server

10:16 AM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home