Create Table SQL Statement (SQL Server Import and Export Wizard)

 

Updated: August 22, 2016

Applies To: SQL Server 2016

If you select Create destination table and then select Edit SQL in the Column Mappings dialog box, , the SQL Server Import and Export Wizard shows the Create Table SQL Statement dialog box. On this page, you review and optionally customize the CREATE TABLE command that the wizard will run to create the new destination table.

System_CAPS_ICON_note.jpg Note

If you're looking for info about the Transact-SQL CREATE TABLE statement, and not about the Create Table SQL Statement dialog box of the SQL Server Import and Export Wizard, see CREATE TABLE (Transact-SQL).

The following screen shot shows the Create Table SQL Statement dialog box of the Wizard.

In this example, the SQL statement box contains the default CREATE TABLE statement generated by the wizard. This statement creates a new destination table that's a copy of the Person.Address source table.

Create table page of the Import and Export Wizard

Options

SQL statement
Displays the auto-generated SQL statement and lets you customize it. For more info about the CREATE TABLE statement and syntax, see CREATE TABLE (Transact-SQL).

If you change the default CREATE TABLE command, you may also have to make changes to the associated column mappings.

To include a carriage return in the text of the SQL statement, press CTRL+ENTER. If you press ENTER alone, the dialog box closes.

Autogenerate
Restore the default SQL statement, if you have modified it, by clicking Autogenerate.

The SQL Server Import and Export Wizard generates a default CREATE TABLE statement based on the connected data source. This default CREATE TABLE statement does not include the FILESTREAM attribute even if the source table has a FILESTREAM column. To copy a FILESTREAM column by using the wizard, first implement FILESTREAM storage on the destination database. Then, add the FILESTREAM attribute manually to the CREATE TABLE statement in the Create Table dialog box. For more info about FILESTREAM, see Binary Large Object (Blob) Data (SQL Server).

After you review and customize the CREATE TABLE command and click OK, the Create Table SQL Statement dialog box returns you to the Column Mappings dialog box. For more info, see Column Mappings.

Community Additions

ADD
Show: