H
haiwen
Hello, everyone:
I want to use an identity column as primary key(id) for a
table(table1), and I want to show the id number(current
identity + 1) before the data is inserted.
but the "SELECT IDENT_CURRENT('table1')" return 1 when
there is not data in the new table and after just insert
one row in the new table. So even the data will be
inserted correctly, there is a error information that id=2
when I am going to insert the first item.
Is there any way to know the table is brand new so that I
don't need to plus 1 to show the id number. or any better
way?
Thanks a lot,
haiwen
I want to use an identity column as primary key(id) for a
table(table1), and I want to show the id number(current
identity + 1) before the data is inserted.
but the "SELECT IDENT_CURRENT('table1')" return 1 when
there is not data in the new table and after just insert
one row in the new table. So even the data will be
inserted correctly, there is a error information that id=2
when I am going to insert the first item.
Is there any way to know the table is brand new so that I
don't need to plus 1 to show the id number. or any better
way?
Thanks a lot,
haiwen