Home Dashboard Directory Help
Search

SELECT INTO Table Variable by Kalman Toth


Status: 

Closed
 as Won't Fix Help for as Won't Fix


1
7
Sign in
to vote
Type: Suggestion
ID: 675068
Opened: 6/11/2011 7:38:14 AM
Access Restriction: Public
0
Workaround(s)
view

Description

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.
Details
Sign in to post a comment.
Posted by Microsoft on 6/20/2011 at 5:07 PM
Hello,
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
Sign in to post a workaround.