I have created a sequence to my database as follows:
DECLARE @max int;
SELECT @max = MAX(customernumber)+1
FROM organisation
exec('CREATE SEQUENCE organisation_customernumber_sequence
START WITH ' + @max +
' INCREMENT BY 1;')
It works and can be used in the application as intended. However, now there's a requirement to have it start from the number 40000.
Somehow I've managed to not find a way to do this. What is the simplest way to set my organisation_customernumber_sequence to 40000 with a single query?