Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to display a message in SQL Server

Posted on 2006-11-28
4
Medium Priority
?
327 Views
Last Modified: 2008-02-26
Hi.  I have a variable named @CheckIt.  I want to be able to display a message saying "CheckIt value is: "  followed by the value in the variable. Does anyone know how to code this in SQL Server?
0
Comment
Question by:dbfromnewjersey
4 Comments
 
LVL 66

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 18031198
SELECT  'CheckIt value is:', @CheckIt
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18031200
> I want to be able to display a message
where?

I guess that you only want this:

print 'CheckIt value is: ' + cast(@checkit as vachar(20))
0
 
LVL 9

Expert Comment

by:gpompe
ID: 18031201
select "CheckIt value is: " + @CheckIt
0
 
LVL 20

Expert Comment

by:Sirees
ID: 18031211
Do you mean something like this

PRINT 'CheckIt value is:' + Convert(Varchar(10),@CheckIt)
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

972 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