TechNet
Export (0) Print
Expand All

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

 

Applies To: SQL Server 2016

In the Column Mappings dialog box, if you select Create destination table and then select Edit SQL, the SQL Server Import and Export Wizard shows the Create Table SQL Statement dialog box. On this page, you can review and customize the CREATE TABLE command that the wizard will run to create the 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).

For more info about how the wizard maps data types from source columns to destination columns, see How the Wizard maps data types from source to destination.

For more info about the SQL Server Import and Export Wizard and how it works, see SQL Server Import and Export Wizard.

System_CAPS_ICON_note.jpg Note


If the Create destination table option and the Edit SQL button are disabled on the Column Mappings page, go back to the Select Source Tables and Views page and enter the name of a new table in the Destination column. After you specify a new destination table or tables and click Next, the Create destination table option is automatically selected and the Edit SQL button is enabled on the Column Mappings page. You can select Edit SQL to show the Create Table SQL Statement dialog box.

The following screen shot shows the Create Table SQL Statement dialog box of the Wizard. To take another look at the Column Mappings dialog box, see Column Mappings (SQL Server Import and Export Wizard).

Create table page of the Import and Export Wizard

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 (SQL Server Import and Export Wizard).

Community Additions

ADD
Show:
© 2016 Microsoft