Currently I have a need in a web interface I'm building in ASP to call a sequence via SQL for an insert statement. However, I have a strong Oracle background and don't know how to create a sequence in SQL Server 2000. Additionally I have a need for a second insert statement on the page to use the currval or same number as the first sequence.
I can explain this better if need be - but basically I'm trying to do the following in SQL Server 2000 like the Oracle equivalent of the following:
insert into students (id, first_name, last_name) values student_sequence.NEXTVAL, 'Scott', 'Smith');
then a second insert statement will place data into another table but use that same id's value:
insert into other_students(id, last_name, grade) values
students_sequence.CURRVAL, 'Smith, 'A')
Thus, I don't know how to create a sequence in SQL Server 2000 nor use the equivalent of nextval and currval