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

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

BKSwindell
Starting Member

USA
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?

Example:

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

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

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

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

BKSwindell
Starting Member

USA
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  
 New 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.05 seconds. Powered By: Snitz Forums 2000