Generate and Publish Scripts Wizard (Advanced Scripting Options Page)

Use this page to specify how you want this wizard to generate scripts. Many different options are available.

Options are greyed out if they are not supported by the version of SQL Server or SQL Azure specified in Database engine type.

Options

Specify advanced options by selecting a value from the list of available settings to the right of each option.

General

  • ANSI Padding
    Includes ANSI PADDING ON in the script. The default is True.

  • Append to file
    When True, this script is added to the bottom of an existing script, specified on the Set Scripting Options page. When False, the new script overwrites a previous script. The default is False.

  • Continue scripting on error
    When True, scripting stops when an error occurs. When False, scripting continues. The default is False.

  • Convert UDDTs to base types
    When True, user-defined data types (UDDT) are converted into the underlying base data types that were used to create them. Use True when the UDDT does not exist in the database where the script will run. When False, UDDTs are used. The default is False.

  • Generate script for dependent objects
    Generates a script for any object that is required to be present when the script for the selected object is executed. The default is True.

  • Include descriptive headers
    When True, descriptive comments are added to the script separating the script into sections for each object. The default is False.

  • Include if NOT EXISTS
    When True, the script includes a statement to check whether the object already exists in the database, and does not try to create a new object if the object already exists. The default is False.

  • Include system constraint names
    When False, the default value of constraints that were automatically named on the origin database are automatically re-named on the target database. When True, constraints have the same name on the origin and target databases.

  • Include unsupported statements
    When False, the script does not contain statements for objects that are not supported on the selected server version or engine type. When True, the script contains the unsupported objects. Each statement for an unsupported object will have a comment that the statement must be edited before the script can be run against the selected SQL Server version or engine type. The default is False.

  • Schema qualify object names
    Includes the schema name in the name of objects that are created. The default is True.

  • Script binding
    Generates a script for binding default and rule objects. The default is False. For more information, see CREATE DEFAULT (Transact-SQL) and CREATE RULE (Transact-SQL).

  • Script collation
    Includes collation information in the script. The default is False. For more information, see Working with Collations.

  • Script defaults
    Includes default objects used to set default values in table columns. The default is True. For more information, see CREATE DEFAULT (Transact-SQL).

  • Script drop and create
    When Script CREATE, Transact-SQL statements are included to create objects. When Script DROP, Transact-SQL statements are included to drop objects. When Script DROP and CREATE, the Transact-SQL drop statement is included in the script, followed by the create statement, for each scripted object. The default is Script CREATE.

  • Script extended properties
    Includes extended properties in the script if the object has extended properties. The default is True. For more information, see Using Extended Properties on Database Objects.

  • Script for engine type
    Creates a script that can be run on the selected type of either SQL Azure or an instance of the SQL Server Database Engine. Objects not supported on the specified type are not included in the script. The default is the type of the origin server.

  • Script for server version
    Creates a script that can be run on the selected version of SQL Server. Features new to a version cannot be scripted for earlier versions. The default is the version of the origin server.

  • Script logins
    When the object to be scripted is a database user, this option creates the logins on which the user depends. The default is False.

  • Script object-Level permissions
    Includes scripts to set permission on the objects in the database. The default is False.

  • Script statistics
    When set to Script Statistics, this option includes the CREATE STATISTICS statement to re-create statistics on the object. The Script statistics and histograms option also creates histogram information. The default is Do not script statistics. For more information, see CREATE STATISTICS (Transact-SQL).

  • Script USE DATABASE
    Adds the USE DATABASE statement to the script. To make sure that database objects are created in the correct database, include the USE DATABASE statement. When the script is expected to be used in a different database, select False to omit the USE DATABASE statement. The default is True. For more information, see USE (Transact-SQL).

  • Types of data to script
    Selects what should be scripted: Data only, Schema only, or both. The default is Schema only.

Table/View Options

The following options apply only to scripts for tables or views.

  • Script change tracking
    Scripts change tracking if it is enabled on the origin database or tables in the origin database. The default is False. For more information, see Change Tracking Overview.

  • Script check constraints
    Adds CHECK constraints to the script. The default is True. CHECK constraints require data that is entered into a table to meet some specified condition. For more information, see CHECK Constraints.

  • Script data compression options
    Scripts data compression options if they are configured on the origin database or tables in the origin database. For more information, see Creating Compressed Tables and Indexes. The default is False.

  • Script foreign keys
    Adds foreign keys to the script. The default is True. Foreign keys indicate and enforce relationships between tables. For more information, see FOREIGN KEY Constraints.

  • Script full-text indexes
    Scripts the creation of full-text indexes. The default is False.

  • Script indexes
    Scripts the creation of indexes. The default is True. Indexes help you find data quickly.

  • Script primary keys
    Scripts the creation of primary keys on tables. The default is True. Primary keys uniquely identify each row of a table. For more information, see PRIMARY KEY Constraints.

  • Script triggers
    Scripts the creation of DML triggers on tables. The default is False. A DML trigger is an action programmed to execute when a data manipulation language (DML) event occurs in the database server. For more information, see Understanding DML Triggers.

  • Script unique keys
    Scripts the creation of unique keys on tables. Unique keys prevent duplicate data from being entered. The default is True. For more information, see UNIQUE Constraints.