title: Facing error of "The default schema does not exist." when executing runtime query inside sp using exec()
body: <p>i have made a runtime query inside a sp and am exceuting the query within the sp using exec(), but when creating the sp i am getting the error</p>
  
  <pre><code>The default schema does not exist.
  </code></pre>
  
  <p>The SP is:</p>
  
  <pre><code>CREATE PROCEDURE MySP
      @tableName varchar(100)
  
  AS
  BEGIN   
      SET NOCOUNT ON;
  
  declare @selectQuery varchar(MAX)
  
  set @selectQuery = 'select * from ' + @tableName
  
  exec(@selectQuery)
  
  end
  </code></pre>
  
  <p>kindly help</p>