ISQL help

  • We are using ISQL to generate comma delimetered reports within a job.

    Some of the reports come out in the following format

    Column1                ,Column2                ,Column3

    while others are coming out like this

    "Column1","Column2","Column3"

    How can we get all the reports coming out in the second format ? What is making the reports come out differently ?

    We are using the following parameters in both the job steps.

    isql /dXXXXX /Q "usp_Stats_XXXXXXX.csv" /w 1000 /s, /o"XXXXXX" /UXXXXXXX /PXXXXXXX

    Could it be a setting within the sp ? (like Ansi Nulls) ?

  • ISQL will produce a fixed column report padded with spaces if necessary.

    Are you sure the procs are the same.

    SELECT Column1,Column2,Column3 FROM [Table]

    will produce

    Column1                ,Column2                ,Column3

    whereas

    SELECT '"'+Column1+'","'+Column2+'","'+Column3+'"' FROM [Table]

    will produce

    "Column1","Column2","Column3"

    Far away is close at hand in the images of elsewhere.
    Anon.

  • I'll check out the code

    Thx

  • I'd also look if you are using the same tables.

    Could someone have coded as "Char" fields instead of "VarChar"



    ----------------
    Jim P.

    A little bit of this and a little byte of that can cause bloatware.

  • The first column in both reports is a varchar (other columns are calculated).

  • Both sp's are structured like this

    SELECT Column1 as [xxx],

    Column2 as [bbb],

    Column3 as [ccc]

    FROM [Table]

  • Looks like I stumbled across a RED Herring. The file I was using as a comparison, had a very similar name but was not generated by ISQL.

    Sorry to waste peoples time.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply