Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add header title above the query result in SQL Server

Tags:

sql-server

How can I add heading title for each query?

I want to display it as a report with a heading above the query result of the table.

Something like this

         HEADING
_____________________________
Alexis M. Smith | PHP 140,500
Johnny K. Black | PHP  50,000
James P. Blonde | PHP  30,000

I am using sql server management 2012 Studio and vb.net 2010 I don't have Business Intelligence to create a report from the sql server to vb.net 2010

like image 822
Syrrea Lee Avatar asked Oct 28 '25 15:10

Syrrea Lee


1 Answers

You may can't add header in your query result in SQL-Server and show the result in your application..

But if you are asking to show the result in SQL-Server only, then this might help you..

--You have to add one select query before your actual query like this.
select '' as 'Your Heading Here' where 1!=1
select * from your_table
like image 135
Raju Prasai Avatar answered Oct 31 '25 05:10

Raju Prasai