Solved

Using ISQL to create a comma delimited output file

Posted on 2008-10-03
2
5,826 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
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert formula to max at a specific date by month 18 18
SQL Help 27 45
Sql server function help 15 30
insert wont work in SQL 14 21
Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

773 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