Solved

How to display a message in SQL Server

Posted on 2006-11-28
4
314 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 65

Accepted Solution

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

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sql 2014,  lock limit 5 32
always on switch back after failover 2 35
How to use three values with DATEDIFF 3 25
SQL invalid column name 5 13
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
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…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

777 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