[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SQL Print Query

Posted on 2011-10-07
2
Medium Priority
?
260 Views
Last Modified: 2012-05-12
Heyas,

Say I want to do an sql query like

SELECT COUNT(ColumnB) FROM table_name

And I want the out to look like:
ColumnB Rows = 56

Is there a way to get the sql statement the return the output in that manner.

Any help would be much appreciated.

Cheers
 
0
Comment
Question by:Zack
2 Comments
 
LVL 23

Accepted Solution

by:
wdosanjos earned 500 total points
ID: 36934924
Try:

Select 'ColumnB Rows = ' + cast(COUNT(ColumnB) as varchar(10)) From table_name
0
 

Author Closing Comment

by:Zack
ID: 36935062
Thank you for your help.
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Screencast - Getting to Know the Pipeline
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

867 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