tags:

views:

53

answers:

1

I have data in a table, but am working on data loading. I want to reseed all new inserts for testing.

What would be the line to set all new inserts to a certain seed value?

+7  A: 

For SQL Server use: DBCC CHECKIDENT (Transact-SQL)

DBCC CHECKIDENT 
( 
        table_name
        [ , { NORESEED | { RESEED [ , new_reseed_value ] } } ]
)
[ WITH NO_INFOMSGS ]

example:

USE YourDatabase;
GO
DBCC CHECKIDENT (YourTable, RESEED, 300);
GO
KM
I don't need to have the column name given, just the table. works fine.Cheers,
Arnej65