Friday, 7 August 2015

Update the table values and Retrieve the updated values by using the magic table values


UPDATE Table1
SET NotificationStatusId = @inProgressId
OUTPUT INSERTED.Id,INSERTED.Email,INSERTED.NotificationStatusId,INSERTED.Dlm,
INSERTED.RetryCount,INSERTED.YearQtr,INSERTED.Inhouse,INSERTED.ReplyToMail,INSERTED.employerCode , INSERTED.StateAccountsID
WHERE NotificationStatusId = @newId OR  (NotificationStatusId = @errorId AND  ISNULL(RetryCount,0) <= @RetryCount)

No comments:

Post a Comment