Sample Header Ad - 728x90

Direct the OUTPUT of an UPDATE statement to a local variable

12 votes
2 answers
7213 views
I would like to do this : DECLARE @Id INT; UPDATE Logins SET SomeField = 'some value' OUTPUT @Id = Id WHERE EmailAddress = @EmailAddress -- this is a parameter of the sproc Is this even possible? I know I can declare a local table variable and direct the output there but I would prefer to skip it if possible
Asked by Andrei Rînea (778 rep)
Aug 17, 2012, 03:30 PM
Last activity: May 16, 2019, 06:16 AM