Solved

Using ISQL to create a comma delimited output file

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Server 2012 Database Restore 4 38
SQL, add where clause 5 23
SQLCMD Syntax 2 13
.NET Enums [Flags] & Bitwise Design Question 6 23
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 …
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

839 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