Solved

Using ISQL to create a comma delimited output file

Posted on 2008-10-03
2
6,656 Views
Last Modified: 2012-05-05
Using the following script to output the contents of an entire table, comma delimited to a txt file.

Was able to get rid of the count using the -n.  Unable to get rid of the column headings which widen the output due to underlines.  How do I get rid of the headings (and heading underlines).  Tried severlaa variations of the "-h" parameter."

THANKS!

Script:
isql -S FFMSSQL -U sa -P  -d filesurf -Q "select * from i_export" -o c:\iexport.txt -n -h -s ","

Output
i_c        ,i_m        ,i_a            ,i_p            
-----------,-----------,---------------,---------------
         34,          1,RE             ,152            
         93,        126,RE             ,156            
        222,          2,TE             ,152            
        528,          3,CL             ,152            
       1155,          6,COMLIT         ,36            
       1231,        203,E              ,155            
       1366,          2,TE             ,152            
       1464,        112,RE             ,152    
0
Comment
Question by:FarrellFritz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22638346
you should look at bcp with the queryout option


http://msdn.microsoft.com/en-us/library/ms162802.aspx
0
 
LVL 19

Accepted Solution

by:
folderol earned 125 total points
ID: 22639333
isql -S FFMSSQL -U sa -P  -d filesurf -Q "select * from i_export" -o c:\iexport.txt -n -h-1 -s ","


-h-1 suppresses headers.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question