SQL Server sequence set current value
As has been mentioned, this would require dynamic SQL since alter sequence requires a constant for the restart
argument.
You might do something like this, then:
DECLARE @sth bigint;
SET @sth = 1000;
DECLARE @sql nvarchar(max);
SET @sql = N'ALTER SEQUENCE StreamEntrySequence RESTART WITH ' + cast(@sth as nvarchar(20)) + ';';
EXEC SP_EXECUTESQL @sql;
Try
ALTER SEQUENCE foo.fee
RESTART
Or:
ALTER SEQUENCE foo.fee
RESTART WITH 1
http://msdn.microsoft.com/en-us/library/ff878572.aspx