title: Select from table with object_id
body: <p>Is is it possible to select Data like this in SQL Server?</p>
  
  <pre><code>select * 
  from table(object_id)
  </code></pre>
  
  <p>I would like so pass the object_id as parameter to the select because I need to select from a global temptable which looks different and has a different name every time. The object_id I get like this:</p>
  
  <pre><code>select object_id('tempdb..##temptableXXX')
  </code></pre>
  
  <p>Thanks for your help!</p>