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.
精彩评论