locked
Dynamic SQL not producing expected results RRS feed

  • Question

  • Hello,

    I am having issues with the piece of code below, not returning expected result.

    DECLARE @SQL VARCHAR(MAX)
     , @SQLBase VARCHAR(MAX)
     , @Criteria VARCHAR(25)
    SET @SQLBase = 'This script is testing the use of N'' and is '
    SET @SQLBase = ''PRINT'' + @SQLBase
    EXECUTE (@SQLBase)

    I am having issues with the piece of code below, not returning expected result.

    This script is testing the use of N' and is 

    Can anyone explain why nothing is being returned upon execution and what to do to resolve this?

    Thank you.

    Friday, June 13, 2014 8:15 PM

All replies

  • this is the Sync Framework developer forum, you might want to post your question to the more appropriate forum (e.g. SQL Server forum)
    Wednesday, June 25, 2014 2:09 AM