Link to home
Start Free TrialLog in
Avatar of craigdev
craigdev

asked on

Scope Identity on remote server

My stored procedure does an insert command to a table with identity(1,1) on a remote server using a synonym.

How can I get the ID of the record that was just inserted?  Scope_Identity() doesn't work, is there any alterative? I can't create an SP on the remote server so that's out of the question.

Is there any other way?
ASKER CERTIFIED SOLUTION
Avatar of JR2003
JR2003

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of craigdev
craigdev

ASKER

not really likely to work as it's a multi-user system
what abt IDENT_CURRENT
Why dont you  create a stored procedure on the remote server which inserts and returns the identity value thru an output variable. then you can create a synonym to that sp and call it from ur local sp
I can't create an SP on the remote server so that's out of the question.
bs