title: SQL PRINT not working in certain instance
body: <p>In the following if I try to place a print after the BEGIN statement it doesn't work, when I remove everything within the BEGIN-END statement and place a print it does work;</p>
  
  <pre><code>SET @SQL = 'IF (((SELECT fldLT FROM #zArray) = ''p'') OR ((SELECT fldMF FROM #zArray) &lt;&gt; -1))
              BEGIN
                  SET @X = '+@Z+' * ((SELECT fldLF FROM #zArray) / 100))
  
                  IF (CAST((SELECT fldMF FROM #zArray) AS FLOAT) &gt; '+@X+')
                      BEGIN
                          SET @X = (CAST((SELECT fldMF FROM #zArray) AS FLOAT))
                      END                         
                  END'   
  
  EXEC sp_executesql @SQL, N'@X NVARCHAR(50),@Z NVARCHAR(50)', @X, @Z
  </code></pre>
  
  <p>Is there something wrong with the following code that would cause the print statement not to work?</p>
  
  <pre><code>    'SET @X = '+@Z+' * ((SELECT fldLF FROM #zArray) / 100))
  
                  IF (CAST((SELECT fldMF FROM #zArray) AS FLOAT) &gt; '+@X+')
                      BEGIN
                          SET @X = (CAST((SELECT fldMF FROM #zArray) AS FLOAT))
  END'
  </code></pre>