创建序列:
CREATE SEQUENCE SEQ_TEST AS [INT] START WITH 1 INCREMENT BY 1 MINVALUE 1 MAXVALUE 2000 CACHE
获取序列的下一个值:
SELECT NEXT VALUE FOR SEQ_TEST
获取序列的当前值:
SELECT CURRENT_VALUE FROM SYS.SEQUENCES WHERE [NAME]='SEQ_TEST'
将序列初始值重置到1
ALTER SEQUENCE SEQ_TEST RESTART WITH 1;