Quotes within quotes in an Agent job question

  • Easy question, and just confirming what I think the answer is.

    If I have some code I want in an Agent job, which has within it already double-quoted information, I don't need to double-double quote, correct?

    Using the below code as an example:

    exec sp_msforeachdb

    'use [?];

    Select whatever, convert(varchar(20),DatabasePropertyEX(''?'',''Status'')),

    etc';

    go

    The proper formatting for this in an Agent job step would be:

    'exec sp_msforeachdb

    ''use [?];

    Select whatever, convert(varchar(20),DatabasePropertyEX(''?'',''Status'')),

    etc''

    go'

    Yes?

    Thanks all!

    Jason A.

  • Never mind, I'm an id10t...

    Forgot I don't need to wrap T-SQL in quotes in a T-SQL job step...

    :Whistling:

Viewing 2 posts - 1 through 2 (of 2 total)

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