Re: save query results to formatted text file

Tech-Archive recommends: Fix windows errors by optimizing your registry



Neither ISQL nor OSQL give you a lot of options for formatting output. To
do that you either need to use a reporting tool like Reporting Services or
maybe load the results into Excell and format the columns in Excell. I
wouldn't recommend using ISQL because it will disappear in the next version.
The -O option in OSQL should give you the same formatting. The -w option
will allow you to set the maximum column width but unless your columns are
of uniform width, that probably won't give you everything you want.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"sneaky" <me@home> wrote in message
news:%23fM$wqWmGHA.5076@xxxxxxxxxxxxxxxxxxxxxxx
Greetings,
I'm very new to SQL & I'm attempting to schedule a weekly query that saves
the results to a formatted text file.

I used osql but the format was wrong. (all spread out, lots of whitespace
& tabbing?)

I am now using isqlw & it looks much better, however the colums are too
wide. The utility mentions a -C configuration file switch - is this where
I can format the output? I can find no reference to what this file should
look like...

Please help me with this command or let me know if I should be using a
different utility entirely.


Thanks



.



Relevant Pages

  • Re: Create Job to dump SP results into a text file.
    ... But its output is in a strange format. ... > As the first content you get, it is because the missing of some switches in> the OSQL utility, and the -L is an exclusive switch in osql utility, so you> get the content of 'The -L parameter can not used in combineation with> others parameters.' ... Could you connect the SQL Server via Query Analyzer by SQL Server> authentication using 'sa'? ...
    (microsoft.public.sqlserver.programming)
  • osql import inserting carriage returns?
    ... I'm trying to run an import of some data that has unix style carriage ... When i use osql to import the ... Or perhaps my database is not configured correctly? ...
    (comp.databases.ms-sqlserver)
  • save query results to formatted text file
    ... I'm very new to SQL & I'm attempting to schedule a weekly query that saves ... I used osql but the format was wrong. ...
    (microsoft.public.sqlserver.tools)
  • Re: Date formats converting when docs sent to Japan
    ... Change your reporting tool to give data that can't be misinterpreted. ... format to dates that Excel will recognise. ... The canned reporting tool provides dates in the mm/dd/yy format, ... "David Biddulph" wrote: ...
    (microsoft.public.excel.misc)
  • RE: Calculating Times
    ... Oracle and downloaded to Excel through a BI reporting tool. ... Excel spreadsheet. ... A number of the columns contain time in the format ... and subsequently format the answer cell it shows 00:00:00, ...
    (microsoft.public.excel.misc)