Applies to ApexSQL Data Diff
Summary This article explains the ApexSQL Data Diff CLI switches, and their usage through the examples.
Description
| /server1 | Specifies server and instance name of the source SQL instance Alias: /s1 Format: /server1:server_name[\instance_name] |
| /server2 | Specifies server and instance name of the destination SQL instance Alias: /s2 Format: /server1:server_name[\instance_name] |
| Quick tip: If a server is not specified "(local)" instance is assumed |
| /database1 | Specifies the name of the source database Alias: /d1 Format: /database1:SourceDatabaseName |
| /database2 | Specifies the name of the destination database Alias: /d2 Format: /database2:DestinationDatabaseName |
| /user1 | Specifies the source login when using SQL Server authentication
Alias: /u1
Format: /user1:sourcelogin
Note: You must use this option together with the /password1 switch |
| /user2 | Specifies the destination login when using SQL Server authentication
Alias: /u2
Format: /user2:destinationlogin
Note: You must use this option together with the /password2 switch |
| Quick tip: If a user is not specified a trusted connection is assumed |
| /password1 | Specifies the source login's password when using SQL Server authentication Alias: /p1 Format: /password1:sourcepassword Note: You must use this option together with the /user1 switch |
| /password2 | Specifies the destination login's password when using SQL Server authentication Alias: /p2 Format: /password2:destinationpassword Note: You must use this option together with the /user2 switch |
| /backup1 | Specifies the file name of the source backup Alias: /b1 Format: /backup1:”SourceBackup.bak” |
| /backup2 | Specifies the file name of the destination backup Alias: /b2 Format: /backup2:”DestinationBackup.bak” |
| Quick tip: The full path of a backup file, along with the backup file extension, e.g. .bak, or .trn, has to be defined, so that command could be correct |
| /backup_set1 | Specifies the name of the backup set in the source backup Alias: /bs1 Format: /backup_set1:SourceBackupSetName |
| /backup_set2 | Specifies the name of the backup set in the destination backup Alias: /bs2 Format: /backup_set2:DestinationBackupSetName |
| /sourcecontrol_ folder1 | Path of a local working folder with script files, when source control is used as source Alias: /scf1 Format: /sourcecontrol_folder1:”SourceControlFolderSource” |
| /sourcecontrol_ folder2 | Path of a local working folder with script files, when source control is used as destination Alias: /scf2 Format: /sourcecontrol_folder2:”SourceControlFolderDestination” |
| /sourcecontrol_ type1 | Type of source control used as the source:
|
| /sourcecontrol_ type2 | Type of source control used as the destination:
|
| /sourcecontrol_ server1 | Name of the source control server used as the source (TFS server, Perforce host)
Alias: /scs1
Format: sourcecontrol_server1:[<protocol> ://<hostname>:<portname>/tfs | https://<accountname>.visualstudio.com/DefaultCollection] (example for Team Foundation Server) Format: /sourcecontrol_server1:<protocol> ://<hostname>:<portname> (example for Perforce) |
| /sourcecontrol_ server2 | Name of the source control server used as the destination (TFS server, Perforce host)
Alias: /scs2
Format: sourcecontrol_server2:[<protocol> ://<hostname>:<portname>/tfs | https://<accountname>.visualstudio.com/DefaultCollection] (example for Team Foundation Server) Format: /sourcecontrol_server2:<protocol> ://<hostname>:<portname> (example for Perforce) |
| /sourcecontrol_ repository1 | Repository of the source control server used as the source (Git, Mercurial, Subversion repository, Perforce depot)
Alias: /scr1
Format: /sourcecontrol_repository1: <protocol>://<hostname>:<portnumber>/<git_server_name> /<repository> (example for Git repository) Format: /sourcecontrol_repository1:<protocol> ://<hostname>:<portnumber>/<repository>/ (example for Mercurial repository) Format: /sourcecontrol_repository1:<protocol> ://<hostname>:<portnumber>/svn/ <repository>/ (example for Subversion repository) |
| /sourcecontrol_ repository2 | Repository of the source control server used as the destination (Git, Mercurial, Subversion repository, Perforce depot)
Alias: /scr2
Format: /sourcecontrol_repository2: <protocol> ://<hostname>:<portnumber>/<git_server_name> /<repository> (example for Git repository) Format: /sourcecontrol_repository2:<protocol> ://<hostname>:<portnumber>/<repository> (example for Mercurial repository) Format: /sourcecontrol_repository2:<protocol> ://<hostname>:<portnumber>/svn/<repository>/ (example for Subversion repository) |
| /sourcecontrol_ user1 | Specifies the login used to connect to the source control server used as the source Alias: /scu1 Format: /sourcecontrol_user1:source_sc_login |
| /sourcecontrol_ user2 | Specifies the login used to connect to the source control server used as the destination
Alias: /scu2
Format: /sourcecontrol_user2: destination_sc_login |
| /sourcecontrol_ password1 | Specifies the password used to connect to the source control server used as the source
Alias: /scp1
Format: /sourcecontrol_password1: source_sc_password Note: You must use this option together with the /sourcecontrol_user1 switch |
| /sourcecontrol_ password2 | Specifies the password used to connect to the source control server used as the destination
Alias: /scp2
Format: /sourcecontrol_password2: destination_sc_password Note: You must use this option together with the /sourcecontrol_user2 switch |
| /sourcecontrol_ branch1 | Branch name for Git source control type when source control is used as source data source ("master" if omitted)
Alias: /scb1
Format: /sourcecontrol_branch1: "source_branch_name" |
| /sourcecontrol_ branch2 | Branch name for Git source control type when source control is used as destination data source ("master" if omitted)
Alias: /scb2
Format: /sourcecontrol_branch2: "destination_branch_name" |
| /sourcecontrol_ project1 | Project path containing script files on the source control server used as the source (Git, Mercurial, Subversion, TFS folder, Perforce workspace) Alias: /scj1 Format: /sourcecontrol_project1:"$/ProjectName" |
| /sourcecontrol_ project2 | Project path containing script files on the source control server used as the destination (Git, Mercurial, Subversion, TFS folder, Perforce workspace) Alias: /scj2 Format: /sourcecontrol_project2:"$/ProjectName" |
| /get_sources_by_ label1 | Get script files from the source control project, used as the source, by label (get latest sources if omitted)
Alias: /scl1
Format: /get_sources_by_label1: "SourceLabelName" |
| /get_sources_by_ label2 | Get script files from the source control project, used as the destination, by label (get latest sources if omitted)
Alias: /scl2
Format: /get_sources_by_label1: "DestinationLabelName" |
| /script_folder1 | Specifies the path of the script folder to be used as the source Alias: /sf1 Format: /script_folder1:”SourceScriptFolder” |
| /script_folder2 | Specifies the path of the script folder to be used as the destination Alias: /sf2 Format: /script_folder2:”DestinationScriptFolder” |
| /collation1 | Default collation for a source control data source used as the source
Alias: /c1
Format: /collation1: SQL_Latin_1_ General_CP1_CI_AS |
| /collation2 | Default collation for a source control data source used as the destination
Alias: /c2
Format: /collation2: SQL_Latin_1_ General_CP1_CI_AS |
| /compatibility_ level1 | Script compatibility level for a source control data source used as the source:
|
| /compatibility_ level2 | Script compatibility level for a source control data source used as the destination:
|
| /project | Specifies a project file path, along with ".axdd" extension Alias: /pr Format: /project:"ProjectName.axdd" |
| Quick tip: If a project file is saved outside of the current directory, specify the path where it’s located. |
| /output_type | Specifies the primary output type of the comparison results, synchronization script, or executable packages:
|
| /output_type2 | Specifies the secondary output type of the comparison results, synchronization script, or executable packages:
|
| /object_types | Specifies bitwise set of object types to be compared (objects of all types are compared if omitted). Available constants:
4 - Views 8 - Tables 12 - Tables and views Alias: /o Format: /object_types:[4|8|12] Bitwise set constants cannot be combined. |
| Quick tip: The number 4 is a bitwise constant that represents views, the number 8 is a bitwise constant that represents tables, and the number 12 is represents both views and tables in switches |
| /output_name | Primary output name/folder path of the comparison results, synchronization script or executable packages ("Synchronize_%date%_%time%.sql" filename, "DataDifference_%date%_%time%.html" filename, "csv_export" folder, "DataDifference_%date%_%time%.xml" filename, "servername.databasename.exe" filename or "servername.databasename" folder if omitted)
Alias: /on
Format: /output_name: ”Synchronize_%date%_%time%.sql" |
| /output_name2 | Secondary output name/folder path of the comparison results, synchronization script or executable packages (“Synchronize_%date%_%time%.sql” filename, “DataDifference_%date%_%time%.html” filename, “csv_export” folder, “DataDifference_%date%_%time%.xml” filename, “servername.databasename.exe” filename or “servername.databasename” folder if omitted) Alias: /on2 |