Solved

Using ISQL to create a comma delimited output file

Posted on 2008-10-03
2
6,310 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
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…

710 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