Can't create sequence in SQL Server 2008

前端 未结 3 2131
感动是毒
感动是毒 2020-12-21 00:08

I have tried to create a sequence in SQL Server 2008 using the following query,

CREATE SEQUENCE serial START 100

I got the following syntax

3条回答
  •  没有蜡笔的小新
    2020-12-21 00:15

    You just cannot do this.

    SQL Server 2008 does not have the concept of a SEQUENCE - this is a new feature in SQL Server 2012 (MSDN documentation here).

    Typically, you want to create an "auto-increasing" column for your table - in that case, use the IDENTITY column attribute instead:

    CREATE TABLE dbo.YourTable
    ( TableID INT IDENTITY,
     .....
    

提交回复
热议问题