Re: A few SQL questions

Dale E. Reed Jr. ( (no email) )
Sat, 05 Sep 1998 14:03:30 -0700

> Kurt Schafer wrote:
> I'm trying to output some sequel queries to text file using SQL-Server
> 6.5
> I can get the files to output to text file by clicking on the SAVE
> icon from the query manager but I need to be able to schedule these
> dumps to text so that a batch process can work on them later.

Use isql from a DOS prompt. If you installed the SQL Client correctly,
its in your path:

C:\>isql /?
isql: unknown option ?
usage: isql [-U login id] [-e echo input]
[-p print statistics] [-n remove numbering]
[-c cmdend] [-h headers] [-w columnwidth] [-s colseparator]
[-m errorlevel] [-t query timeout] [-l login timeout]
[-L list servers] [-a packetsize]
[-H hostname] [-P password]
[-q "cmdline query"] [-Q "cmdline query" and exit]
[-S server] [-d use database name]
[-r msgs to stderr] [-E trusted connection]
[-i inputfile] [-o outputfile]
[-b On error batch abort]
[-O use Old ISQL behavior disables the following]
<EOF> batch processing
Auto console width scaling
Wide messages
default errorlevel is -1 vs 1
[-? show syntax summary (this screen)]

> Also, when I do save the file it sticks ^M at the end of every row
> result. This is wreaking havoc on the unix machine that I'm trying to
> parse from later. (the SQL server writes directly to the unix host)

Might I recommend a search for a little program called dos2unix that
should be available for most unix flavors. It rips the ^M off of
text files.

-- Dale E. Reed Jr.  (       IEA Software, Inc.      |  RadiusNT, Emerald, and NT FAQs Internet Solutions for Today  |