Applies to ApexSQL Build
Summary This article explains the ApexSQL Build CLI switches, and their usage through the examples
Description
Connection switches
/server | Specifies server and instance name of the source SQL instance Alias: /s Format: /server:server_name[\instance_name] |
| Quick tip: If a server is not specified (local) instance is assumed |
/database | Specifies the name of the database to connect to Alias: /d Format: /database:DatabaseName |
| Quick tip: If a database name is not specified DefaultDb will be used |
/user | Specifies the login when using SQL Server authentication
Alias: /u
Format: /user:login
Note: You must use this option together with the /password switch |
| Quick tip: If a /user is not specified a trusted connection is assumed |
/password | Specifies the login when using SQL Server authentication Alias: /p Format: /password:pa$$w0rd Note: You must use this option together with the /user switch |
Create database switches
/database_script | Full path to a script that will be used for creating a database (with corresponding extension “.sql”) Alias: /ds Format: /database_script:”CreateDB.sql” |
/database_ script_type | Specifies how database script will be created:
|
/db_dir | The MDF file of the database created by generated script will be created in the specified directory Alias: /dbd Format: /db_dir:”DatabaseFolderName” |
/db_logdir | The LDF of the database created by generated script will be created in the specified directory Alias: /dbld Format: /db_logdir:”DatabaseLogDirectory” |
/db_collation | Specifies the database collation Alias: /dbc Format: /db_collation:Latin1_General_CI_AS |
/db_recovery | Specifies the recovery mode for the database:
Omitting this switch will result in setting simple as a default recovery mode |
/db_size | Specifies the size for the database in KB, MB, or GB Alias: /dbs Format: /db_size:1024KB |
/drop_if_exists | Checks if database exists and drops it Alias: /die Format: /drop_if_exists |
Script switches
/include_ static_data | Include static data from loaded input source into tables Alias: /isd Format: /include_static_data |
/invalid_objects | Enforces deferred name resolution. When it is used, a warning will be generated if an invalid object is referenced by a procedure. Alias: /io Format: /invalid_objects |
/include_ transaction | Wrap the created script statements into explicit transactions. Any errors that occur during the script execution will roll back the transactions and leave the database in the state it was before the statements were executed Alias: /ith Format: /include_transaction |
/script_ansi_ options | Add the SET ANSI_PADDING ON/OFF and SET ANSI_NULLS ON/OFF options to the output script before each object is affected Alias: /sao Format: /script_ansi_options |
/script_drops | Add DROP statements to the output script for each object before the corresponding CREATE statement is scripted Alias: /sdr Format: /script_drops |
/script_ collation | Add collation scripts for character columns to the output script in CREATE TABLE statements Alias: /sc Format: /script_collation |
/script_extended_ properties | Script extended properties for object types where applicable Alias: /sep Format: /script_extended_properties |
/script_filegroups | Script available database filegroups with the existence check Alias: /sfg Format: /script_filegroups |
/script_logins | Script SQL Server logins that the scripted database users are based on Alias: /slg Format: /script_logins |
/script_names | Script index, foreign key and constraint names Alias: /snm Format: /script_names |
/script_ permissions | Scripts permissions granted, denied or revoked on objects where applicable Alias: /sp Format: /script_permissions |
/script_triggers | Script existing table/view triggers along with the parent object Alias: /str Format: /script_triggers |
/script_use | Add USE <database name> statements to the output scripts Alias: /su Format: /script_use |
| Quick tip: If a /database_script_type is not specified from_application is assumed |
Specific switches
/project | Full path to the project file, along with the “.axbd” extension Alias: /pr Format: project:”ProjectFile.axdb" |
| Quick tip: If a project file is saved outside of the installation directory, specify the path where it’s located |
/project_type | Specifies project type:
If omitted, build_db is assumed |
/output_type | Specifies output type:
If omitted, database is assumed |
/output_name | Full path to an output file or folder folder (“Build_script_%date%_%time%.sql” filename, “Package_%date%_%time%.exe” filename or “Package_%date%_%time%” folder if omitted) Alias: /on Format: /output_name:”Build_script_%date%_%time%.sql” |
/source_type | Specifies source type:
If omitted, sql is assumed |
/source_name | Full path to source file (with corresponding extension “.sql” or “.axsnp”) or folder, except for source control (use source control options for source input) Alias: /sn Format: /source_name:”SnapshotFile.axsnp” |
/output_ action_type | Specifies output action type:
[create|create_execute] Note: These arguments cannot be combined. If omitted, create_execute is assumed |
/compatibility_ level | Sets database compatibility level:
|
/postscript_ file_path | Full path to the post-deployment script, along with the “.sql” extension Alias: /postfp Format: /postscript_file_path:”PostScript.sql” |
/output_elements | Specifies a set of the optional output elements:
The Author and Legal values must be used together with the /author and /legal switches |
/author | Specifies the name of author in the header of the comparison report or the synchronization script
Alias: /auth
Format: /author:”John Doe” Note: If the /author switch is specified, its dependent switch and value /output_elements:a need to be provided |
/legal | Specifies the legal information in the header of the comparison report or the synchronization script
Alias: /leg
Format: /legal:”© ApexSQL LLC” Note: Note: If the /legal switch is specified, its dependent switch and value /output_elements:l need to be provided |
Source control switches
/sourcecontrol_ type | Type of source control used as the source:
|
© ALL RIGHTS RESERVED. 使用条款 隐私 Cookie Preference Center