How to create sequence in SQL Server 2008

后端 未结 6 1351
执笔经年
执笔经年 2021-01-02 23:37

I am creating sequence in SQL Server with the following code. But it displays error as unknown object type. Please give a solution

Here\'s my code :

         


        
6条回答
  •  说谎
    说谎 (楼主)
    2021-01-03 00:16

    Are you sure you're running 2012? I had no trouble with:

    CREATE SEQUENCE seqval
    START WITH 100
    INCREMENT BY 1 
    minvalue 100 maxvalue 10000 NO CYCLE
    

    Your 0,0 values generated a syntax error for me but a clear and simple one.

    The minimum value for sequence object 'seqval' must be less than its maximum value.
    

提交回复
热议问题