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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Add A Header Row to Record Set

Author  Topic 

Mauricio Moreno
Starting Member

18 Posts

Posted - 2007-08-08 : 18:15:17
I am using SQL Query Analizer and i am creating a statement like

select id, product, image, price
from products

and then taking the resulting set and doing a save to tab delemited file that i use for uploading to a third party site...

Problem is that i need row 1 to have the column names so they will be included on the tab delemited file?

How would i write that into the select statement?

any help would be great!!!

~ Moe

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-08-08 : 18:20:46
Try to get the "Results in Text" mode and see if it helps..

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

Mauricio Moreno
Starting Member

18 Posts

Posted - 2007-08-08 : 18:45:33
Thank you, i tried that but then i lost the ability to save the record set to txt file... any other suggestions?
Go to Top of Page

tran008
Starting Member

38 Posts

Posted - 2007-08-09 : 08:43:55
from QA select tool | option. Expand query results, sql server, result to grid, check include header.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-08-09 : 08:47:59
or try this as well
http://weblogs.sqlteam.com/brettk/archive/2005/04/13/4395.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-09 : 15:07:28
In SQL Server 2005, the Tool -> Option thingy works for GRID mode as well.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -