In order to insert the default values including the "auto-increment" value, you need to use DEFAULT VALUES
in your INSERT
. Also, you need to have at least a ;
between your INSERT
and your SELECT SCOPE_IDENTITY()
(your current code doesn't have a space nor a semicolon between the two statements):
string strITStaff = "INSERT INTO ITReq DEFAULT VALUES; SELECT SCOPE_IDENTITY()";
This will insert all default values into the ITReq
table, and then select the newly inserted IDENTITY
from that table.