Solved

Using ISQL to create a comma delimited output file

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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
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 setup several different housekeeping processes for a SQL Server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now