I was just trying this knowing that my select would return one row. Is something like this possible or will I need a temporary variable?
lets say my stored procedure took one parameter:
exec dbo.GetUserData @UserName = UserName from @MyTempTable where UserId= @UserId
Or what if the parameter expected was XML? Is there a way I can do something like
exec dbo.GetUserData @UserXml =
select
case
when @val = 1 then '1'
when @val = 0 then '0'
else NULL
end as '@MyId',
@ThisId as '@ThisId',
@ThatId as '@ThatId'
FOR XML PATH('Info')