开发者

Convert Oracle query about unique number to SQL Server 2008

Can anyone help me convert this from Oracle to SQL Server 2008?

CREATE SEQUENCE seq

   开发者_Go百科 MINVALUE 1
    MAXVALUE 9999
    START WITH 1
    INCREMENT BY 5
    CACHE 30;

seq.nextval


There is no way to convert this to SQL Server as SQL Server is one of the few DBMS that does not support sequences.

If this is used to generate an artificial primary key, you need to look into identity columns or use GUIDs as a PK replacement.

But even if switch to identity columns there is no way to retrieve the "next value" for them. They are only assigned when inserting new rows.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜