troubleshooting Question

How do I customize the header using OSQL

Avatar of sainiak
sainiakFlag for United States of America asked on
Microsoft DOSMicrosoft SQL Server 2005
2 Comments1 Solution668 ViewsLast Modified:
I have a DOS batch job that runs an OSQL command.

osql -dION_Data -E -ieaf8.sql -l -n -oeaf8.txt -s"      " -SMAPOW\ION -w500

If I use the -h-1 parameter, I see just the data:
23-Jul-2007 11:11:11.00<TAB>1.0<TAB>22.2222<TAB>&
23-Jul-2007 11:11:12.00<TAB>1.0<TAB>22.2222<TAB>&
23-Jul-2007 11:11:13.00<TAB>1.0<TAB>22.2222<TAB>&

If I omit the parameter, I see the column name and a line of hyphens:
DATETIME<TAB>TAP_POSITION<TAB>CURRENT_PHASE_A<TAB>&
------------<TAB>------------------<TAB>--------------------------<TAB>&
23-Jul-2007 11:11:11.00<TAB>1.0<TAB>22.2222<TAB>&
23-Jul-2007 11:11:12.00<TAB>1.0<TAB>22.2222<TAB>&
23-Jul-2007 11:11:13.00<TAB>1.0<TAB>22.2222<TAB>&

Is there a way to keep the column names and suppress the 2nd line (the hyphens)?
If not, I need to suppress the header (-h-1) and manually output the column names (tab delimited).  How can I do this from my SQL input file?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros