tags:

views:

38

answers:

1

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

+1  A: 

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();
Justin Grant