Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Dynamic Column Names
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

6 Posts

Posted - 11/05/2013 :  08:10:50  Show Profile  Reply with Quote
Is it possible to set the column names in a query dynamically with out the use of dynamic SQL?


SELECT OrderID as "Order_Number"'
Amount as "Total $" & (SELECT SUM(Amount) FROM Orders)
FROM Orders

Should Return:

Order_Number. Total $5000
1234. 1500
6346. 3000
7245. 500

Thanks for the help.

Brad Swindell

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 11/05/2013 :  08:25:46  Show Profile  Reply with Quote
Not possible

SQL Server MVP
Go to Top of Page

Starting Member

6 Posts

Posted - 11/05/2013 :  08:27:34  Show Profile  Reply with Quote
I didn't think so. Just checking. Thanks for the reply.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000