title: How to insert result of Stored Procedure into Temp Table without declaring Temp Table Columns
body: <p>I want to insert the values of stored procedure into a temp table without predefining the columns for the temp table. </p>
  
  <pre><code>Insert Into #Temp1 Exec dbo.sp_GetAllData @Name = 'Jason'.
  </code></pre>
  
  <p>How can I do this ?  I saw an option as below but can I do it without mentioning the server name ? </p>
  
  <pre><code>SELECT * INTO #TestTableT FROM OPENROWSET('SQLNCLI', 'Server=localhost;Trusted_Connection=yes;',
  'EXEC tempdb.dbo.GetDBNames')
  -- Select Table
  SELECT *
  FROM #TestTableT;
  </code></pre>