title: sp_executesql not showing desired result
body: <p>I am working on SQL in SQL Server and come across this problem where,</p>
  
  <pre><code>set @sqlString=N'select @max=MAX('+@columnName+') from @temp';
  exec sp_executesql @sqlString,
               N'@temp as Table_Type readonly, @max nvarchar(max)', @temp ,@max;
  </code></pre>
  
  <p>I have tested this sql statement without parameters and it was working but like this it's showing null in @max.
  Please help me out where am i going wrong!!</p>