Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2004
    Posts
    268

    Unanswered: OSQL Query Output

    Hi All,

    The command showed below provides the output shown:

    set @cmd = 'osql -S bcgsql1\bcgsqldev -U checkdb -P checkdb -q "set nocount on; select errorlogdesc from ##errors where datediff(dd,errorlogdatetime,getdate()) = 1 and errorlogdesc like ''%Error:%''" -h-1 -w 900 -o J:\Scripts\TestStuff\ErrorLogMsg.txt'


    Here is the output:

    Error: 17883, Severity: 1, State: 0




    Error: 17883, Severity: 1, State: 0


    I need to remove the space between the two lines so I set the -w parameter to 900 but that didn't fix it. Any idea how I can accomplish this?

    Thanks

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    How wide is the errorlogdesc field?

  3. #3
    Join Date
    Jul 2004
    Posts
    268
    The errorlogdesc field is 8000 characters.

  4. #4
    Join Date
    Nov 2006
    Location
    Quebec
    Posts
    172
    errorlogdesc is varchar or char

    maybe you can use RTRIM(errorlogdesc)
    Less is more.
    How long is now?
    http://www.lesouterrain.com

  5. #5
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    cast(errorlogdesc as varchar(900)) or whatever your -w value is.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •