Applies to ApexSQL Script
Summary This article explains the ApexSQL Script CLI switches, and their usage through the examples Description/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(s) to connect to
Alias: /d
Format: /database:DatabaseName
Note: If you specify more than one database, then each database name must be separated by a single space |
/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's password when using SQL Server authentication Alias: /p Format: /password:password Note: Note: You must use this option together with the /user switch |
/db_dir | The MDF file of the database created by generated script will be created in the specified directory Alias: /dbd Format: /db_dir:D:\ApexSQL |
/db_logdir | The LDF of the database created by generated script will be created in the specified directory Alias: /dbld Format: /db_logdir:log_directory |
/db_collation | Specifies the database collation Alias: /dbc Format: /db_collation:latin_GENERAL_CI_AS |
/db_recovery | Specifies the recovery mode for the database:
|
/db_size | Specifies the size for the database in KB, MB, or GB Alias: /dbs Format: /db_size:1024KB |
/output_type | Specifies the output type:
|
/individual | Specifies whether object will be written to an individual file. Script to single file if omitted Aias: /in Format: /individual Note: This argument cannot be used with /cf switch Omitting this switch will result in scripting to a single file |
/create_file | Creates separate file for each database Alias: /cf Format: /create_file |
/folder | Specifies the output folder for script each object to an individual file Alias: /fl Format: /folder:”D:\ApexSQL\Scripts” |
Quick tip: The switch /folder should be used along with the switch /individual |
/encoding | Specifies the output file encoding:
|
/folder_mapping | Creates folder mapping as specified in the previously created folder mapping (XML) file. Alias: /fm Format: /folder_mapping:MyMappings.xml Omitting this switch will result in setting a default mapping |
Quick tip: The switch /folder_mapping should be used along with the switch /individual |
/project | Specifies a project file path Alias: /pf Format: /project:project.axsc |
Quick tip: If a project file is saved outside of the installation directory, specify the path where it’s located |
/mode | Specifies the scripting mode:
|
/includes | Specifies the object selection profile path Alias: /i Format: /includes:profile.xml Omitting this switch will result in including all objects |
/include | Includes specific objects in the processing. Objects can be specified by first specifying a bitwise set and a regular expression. Multiple includes can be specified with spaces in between. Alias: /inc Format: /include:bitwise_constant:regular expression |
/exclude | Excludes specific objects from the processing. Objects can be specified by first specifying a bitwise set and a regular expression. Multiple excludes can be specified with spaces in between. The /exclude switch is processed after the /include switch (if it is specified) Alias: /exc Format: /exclude:bitwise_constant:regular expression |
/oe:arg [ /output_elements ] | A set of the output elements options: None [n] Author [a] DateTime [dt] Legal [l] Comments [cmt] PrintStatements [ps] Default [dft] - Combination of Comments and PrintStatements Note: Arguments can be combined. Author and Legal are paired with /author and /legal switches.
|
/on:arg [ /output_name ] | Output name/folder path of the SQL script, script folder or executable packages ("Script_%date%_%time24%.sql" filename, "Script_folder_%date%_%time12%" folder name, "Package_%date%_%time12%.exe" filename or "Package_%date%_%time24%" folder if omitted) |
/owner_type | Specifies the owner mapping type:
|
/owner_map | Specifies the owner map Alias: /owmp Format: /owmp:"old;new dbo;test" |
/no_transaction | Exclude transaction handling Alias: /nth Format: /no_transaction_handling |
/no_increment | The version number of the project is not automatically incremented Alias: /niv Format: /no_increment_version |
/no_scr_use_db | Do not script USE database Alias: /nscu Format: /no_scr_use_db |
/include_dependent | Include dependent database objects Alias: /sid Format: /include_dependent |
/scr_create_db | Script CREATE database Alias: /scdb Format: /scr_create_db |
/scr_filegroups | Script filegroups Alias: /scf Format: /scr_filegroups |
/scr_logins | Script logins with users Alias: /sck Format: /scr_logins |
/no_scr_names | Do not script names Alias: /scn Format: /no_scr_names |
/scr_collations | Script collations. This argument applies only to table objects Alias: /scc Format: /scr_collations |
/no_scr_ansi_options | Do no script ANSI options Alias: /nsca Format: /no_scr_ansi_options |
/scr_triggers | Script triggers with parent table, or view Alias: /sct Format: /scr_triggers |
/scr_permissions | Script database permissions Alias: /sco Format: /scr_permissions |
/scr_drops | Script drops Alias: /scd Format: /scr_drops |
/scr_ex_properties | Script extended properties Alias: /sce Format: /scr_ex_properties |
/dbcl:arg [ /db_compatibility _level] | Set script compatibility level for database ("default" if omitted)
|
/no_data_identity_on | Do not include SET IDENTITY_INSERT ON in the generated script Alias: /ndio Format: /no_data_identity_on |
/data_distinct | Only distinct rows are scripted. Duplicate rows are discarded Alias: /ddr Format: /data_distinct |
/data_delete | Use DELETE statements Alias: /dd Format: /data_delete |
/data_rows | Set data rows to script:
Alias: /drs
|
© ALL RIGHTS RESERVED. Nutzungsbedingungen Datenschutz Cookie Preference Center