--Creating a
sequence
CREATE SEQUENCE [DBO].[seq_mySequence]
AS [BIGINT]
START WITH 1
INCREMENT BY 1
MINVALUE 1
MAXVALUE 999
GO
--Generating sequence
SELECT NEXT VALUE FOR [DBO].[seq_mySequence] AS Seq
GO
----Alter or
Reset sequence----
ALTER SEQUENCE [DBO].[seq_mySequence]
RESTART WITH 101
INCREMENT BY 1
MINVALUE 101
MAXVALUE 999
GO
--Calling
sequence----
SELECT NEXT VALUE FOR [DBO].[seq_mySequence] AS Seq
GO
No comments:
Post a Comment