cannot get a value from scope_identity after insert
In ASp i am doing this:
set objrs=objconn.execute("insert into cart (title) values ('something');select SCOPE_IDENTITY() as id;")
When I check objrs("ID") it returns blank. Nothing. This works fine access but not in SQL 2000. I find that it seems to have something to do with it being in the second line of the SQL. if I replace the scope_identity() with max(cartid) i get the same thing. So the second line is not returning a value.
Running this in the query analyzer DOES return the value as expected.
Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.