Can anyone help me convert this from Oracle to SQL Server 2008?
CREATE SEQUENCE seq
MINVALUE 1
MAXVALUE 9999
START WITH 1
INCREMENT BY 5
CACHE 30;
seq.nextval
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.