I have a situation where I need to restart a sequence to a specified value, where this value is specified in either a variable or passed as a parameter programically from a C# program.
The following code is an example of what I hoped would work, but didn't:
DECLARE @current_value AS BigInt = 60000;
ALTER SEQUENCE
usq_MySequence
RESTART WITH
@current_value
Something like this does work:
ALTER SEQUENCE
usq_MySequence
RESTART WITH
60000
however that's hard coded, and the program I'm interacting with will only pass parameters (Using the SqlCommand in .NET)
Is there anyway to reset a sequence with a variable or parameter?
<constant>and nothing else for specifying the values.