In addition to the existing table syntax described in the previous section, additional syntax is provided to allow the specification of proxy table attributes when you want to create a proxy table through the select into statement. The new syntax is:
select <column_list> into <newtablename> [[external <type>] at "location_string" [column delimiter "<string>"]] from <source_table(s) [where...]
Using this syntax, you don’t need to use sp_addobjectdef to specify the location of a proxy table. All attributes of a proxy table can be specified with this new select into syntax.
The new table created will be 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 only valid if the new type is file., and if used to specify the string used to delimit separate fields within the file. The default is a tab character.
In addition to the above syntax, new syntax is provided to enable the select into command when tables already exist:
select <column_list> into existing table <newtablename> from <source_table(s) [where...]
The option existing table is new, and allows the command to operate on tables that have previously been created. A check is made to ensure that the datatypes of the column_list match, in type and length, the data types 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 exist:
The statement containing the existing table option cannot be used in a procedure, trigger or view.
The target table (the “existing table”) must be a proxy table. Using this syntax for local tables is not allowed. (Use insert select instead.)