RTrim... ?

  • Hello Everyone,

    How do I trim the output of this query ?

    use msdb

    go

    SELECT command FROM msdb.dbo.sysjobsteps

    I do not want the extra spaces at the end of each row.

    Thanks

    Chandra

  • You do or do not want to trim spaces?

    ltrim() - trims left

    rtrim() - trims right.

    Steve Jones

    sjones@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/sjones

  • Its not that I do or do not want to use those functions, the thing is they dont work.

    I tried converting it to varchar,char, then ltrim/rtrim but somehow it does not work.

    Please let me know if you have any other options.

    Thanks,

    Chandra

  • I just ran

    SELECT command,len(command) FROM msdb.dbo.sysjobsteps

    and didn't see and spaces at the end of command, are you talking about the grid output in query analyser?

    Regards,

    Andy Jones

    .

  • I am talking about 'Result in Text' in QA,

    (As I want to store the output in a txt file).

Viewing 5 posts - 1 through 4 (of 4 total)

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