I am doing an insert from one server to another linked server. I need to have the Identity Key returned to me from the linked server.
My statement looks like this:
DECLARE @newids TABLE (id INT)
INSERT INTO LinkedServer.LinkedDB.dbo.LinkedTable
( Column1 ,
OUTPUT INSERTED.MyNewid INTO @newids(id)
SELECT Column1 ,
I am getting this error:
A remote table cannot be used as a DML target in a statement which includes an OUTPUT clause or a nested DML statement.
Does anyone know how I can solve this issue.