Link to home
Start Free TrialLog in
Avatar of riaancornelius
riaancornelius

asked on

how to print value of variable

i use something like:

declare @user nvarchar(50)
set @user = select value from mytable

how do I then print the value of @user to the screen. I've seen it done but can't remember how.
Avatar of Otana
Otana

declare @user nvarchar(50)
select @user = value from mytable
select @user
ASKER CERTIFIED SOLUTION
Avatar of Thandava Vallepalli
Thandava Vallepalli
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of riaancornelius

ASKER

there's another way. in QA you you can output  to 'messages' not 'grids'

declare @user nvarchar(50)
select @user = value from mytable
print @user

itsvtk
In that case, use print like itsvtk said.
declare @user nvarchar(50)
select @user = value from mytable
print @user

sorry didn't see this. thanks