• Here is one way:

    -- Setup the variable for testing

    Declare @value varchar(1000);

    Set @value = 'select * from table 2 where something in (''a'', ''b'', ''c'')';

    Select @value; -- this will look like select * from table 2 where something in ('a', 'b', 'c')

    Select quotename(@value, ''''); -- 'select * from table 2 where something in (''a'', ''b'', ''c'')

    Jeff

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs