Tuesday, July 29, 2014

how to get last column

If its a batch insert you'll need output clause for this


The stub will look like below



INSERT INTO Address
SELECT MemberID,
...
FROM
(
MERGE member as d
USING (SELECT firstname,lastname,...) AS s
ON 1=2
WHEN NOT MATCHED THEN
INSERT (firstname,lastname,..)
VALUES (s.firstname,s.lastname,...)
OUTPUT INSERTED.MemberID,..
)r (MemberID,...)





Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c


No comments:

Post a Comment