Dec 9, 2003 #1 chicdog Programmer Joined Feb 28, 2002 Messages 84 Location US Is it possible to set two variables to receive the result of a Select statement knowing that there will be ONLY one row returning. SET @Var1, @Var2 = (Select A,B From tblTable Where Key=3) Thanks, Bryan
Is it possible to set two variables to receive the result of a Select statement knowing that there will be ONLY one row returning. SET @Var1, @Var2 = (Select A,B From tblTable Where Key=3) Thanks, Bryan
Dec 9, 2003 1 #2 jby1 Programmer Joined Apr 29, 2003 Messages 403 Location GB Code: Select @Var1=A, @Var2=B From tblTable Where Key=3 You will need to declare @Var1 and @Var2 before doing this. Upvote 0 Downvote
Code: Select @Var1=A, @Var2=B From tblTable Where Key=3 You will need to declare @Var1 and @Var2 before doing this.
Dec 9, 2003 Thread starter #3 chicdog Programmer Joined Feb 28, 2002 Messages 84 Location US Thank you for the help. Bryan Upvote 0 Downvote