SELECT INTO Table Variable - by Kalman Toth

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 675068 Comments
Status Closed Workarounds
Type Suggestion Repros 0
Opened 6/11/2011 7:38:14 AM
Access Restriction Public


SELECT INTO should work the same way with Table Variable as it works with tables and temporary tables. It should create and populate the Table Variable.
Sign in to post a comment.
Posted by Microsoft on 6/20/2011 at 5:07 PM
Thanks for your feedback. SELECT INTO statement today in SQL Server is a special statement / extension that creates table & populates data in a single statement. Using same syntax for table variables is not possible. For example, with variable the type needs to be inferred at compile time itself. If the schema is not known in case of table variable then we cannot verify the references to the variable and SQL Server doesn't have a concept of empty table schema. So there are lot of semantic issues adding such support to variables.
So I am closing this feedback item as "won't fix".

Umachandar, SQL Programmability Team