select into

There is syntax that allows the specification of proxy table attributes when you want to create a proxy table through the select into statement. The syntax is:

select <column_list> into <newtablename>
[[external <type>] at "location_string"
[column delimiter "<string>"]]
from <source_table(s)  [where...]

Using this syntax, you do not need to use sp_addobjectdef to specify the location of a proxy table. You can specify all attributes of a proxy table with this new select into syntax.

The new table created is a proxy table if the clause at location_string is provided. The external <type> qualifier is used to indicate that the new proxy table is mapped to a remote table, a directory, or a file. The column delimiter is valid only if the new type is file, and only if the delimiter is used to specify the string used to delimit separate fields within the file. The default is a tab character.

There is also syntax that enables select into when tables already exist:

select <column_list> into existing table <newtablename>
	from <source_table(s) [where...]

A check is made to ensure that the datatypes of the column_list match, in type and length, the datatypes of the target table. If the source columns can be NULL, the corresponding column in the target table must also allow NULL. Additional restrictions on the use of existing table syntax include: