I am running a cross server insert
INSERT INTO server.database.dbo.table (Field) VALUES('test')
Afterward, I need to get the id of the last insert. However, when I run the the scope_identity function, I don't get the latest id from the foreign server.
SELECT @ID=SCOPE_IDENTITY()
How would I retrieve the last id from a cross server insert?