Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to display a message in SQL Server

Posted on 2006-11-28
4
Medium Priority
?
325 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
[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
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
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 ?
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

670 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