为什么这给我相同的值,四个 1?
USE [TSQL2012]
GO
IF OBJECT_ID('dbo.sqlsequence', 'SO') IS NOT NULL
DROP SEQUENCE dbo.sqlsequence;
GO
CREATE SEQUENCE [dbo].[SQLSequence] AS INT
START WITH 1
MAXVALUE 8 CYCLE
SELECT NEXT VALUE FOR
[dbo].[SQLSequence] AS [Seq1] ,
NEXT VALUE FOR
[dbo].[SQLSequence] AS [Seq2] ,
NEXT VALUE FOR
[dbo].[SQLSequence] AS [Seq3] ,
NEXT VALUE FOR
[dbo].[SQLSequence] AS [Seq4]
但这按预期工作正常。给我 1、2、3、4
USE [TSQL2012]
GO
IF OBJECT_ID('dbo.sqlsequence', 'SO') IS NOT NULL
DROP SEQUENCE dbo.sqlsequence;
GO
CREATE SEQUENCE [dbo].[SQLSequence] AS INT
START WITH 1
MAXVALUE 8 CYCLE
SELECT NEXT VALUE FOR
[dbo].[SQLSequence] AS [Seq1]
SELECT NEXT VALUE FOR
[dbo].[SQLSequence] AS [Seq2]
SELECT NEXT VALUE FOR
[dbo].[SQLSequence] AS [Seq3]
SELECT NEXT VALUE FOR
[dbo].[SQLSequence] AS [Seq4]
根据文档说明: