ProNotion
ProNotion

Reputation: 3692

Seed Identity Column

Is is possible to set the seed for the identity column of a table using SubSonic?

Upvotes: 1

Views: 113

Answers (1)

Justin Grant
Justin Grant

Reputation: 46713

AFAIK, you need to shell out to SQL to be able to do this in SubSonic. Every DBMS has a different syntax for changing the seed, but if you know which DBMS you're using then injecting a little SQL isn't hard. For example, for SQL Server from C#, the code would be something like this:

new InlineQuery("DBCC CHECKIDENT (\"MyTable.ColumnName\",RESEED,300)").Execute();

Upvotes: 1

Related Questions