?
Solved

how to print value of variable

Posted on 2005-03-17
6
Medium Priority
?
214 Views
Last Modified: 2012-05-05
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.
0
Comment
Question by:riaancornelius
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 11

Expert Comment

by:Otana
ID: 13572365
declare @user nvarchar(50)
select @user = value from mytable
select @user
0
 
LVL 14

Accepted Solution

by:
Thandava Vallepalli earned 1000 total points
ID: 13572376
declare @user nvarchar(50)
set @user = select value from mytable
print @user

itsvtk
0
 
LVL 9

Author Comment

by:riaancornelius
ID: 13572377
there's another way. in QA you you can output  to 'messages' not 'grids'
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 14

Expert Comment

by:Thandava Vallepalli
ID: 13572390

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

itsvtk
0
 
LVL 11

Expert Comment

by:Otana
ID: 13572392
In that case, use print like itsvtk said.
0
 
LVL 9

Author Comment

by:riaancornelius
ID: 13572409
declare @user nvarchar(50)
select @user = value from mytable
print @user

sorry didn't see this. thanks
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question