synch one single table via commandline
jonathanatviinc
Posts: 3
I'm using sqldatacompare 5.2 command-line interface
I'm attempting to synch a single table named Users. I am using an index named 'IX_Users_UserName' which is not the primary key, but it is unique. The problem I am running into is that when attempting to synch the 'users' table, there is another table named 'ConsumerSiteUsers'. I can't seem to exclude this table from my comparrisons. (Because it has 'users' in it's table name)
Here is my syntax.
SQLDataCompare.exe /s1 laptop /s2 laptop /db1 Source /db2 Destination /ck:users:IX_Users_UserName /include:Table:\[Users] /exclude:Table:\[ConsumerSiteUsers] /comparisonkeys:users:username /options:d /cols:users:RoleID,DateCreated,DateLastChangedPassword,DateLastLoggedOn,username,userNameIsEmail,FirstName,LastName,PhoneNumber,PhoneExtension,DateLastVerifiedEmail,EmployeeNum,WizardEnable,DateLocked,PasswordHash,Salt,SecretQuestionID,SecretAnswer /v /ignoremissing /ignoreadditional
There are 2 colums in this table that I cannot replicate. Hence why I'm using an index key 'IX_Users_UserName, and specifying 18 of the columns.
Below is the error I receive:
Error: Invalid comparison keys specified for [dbo].[ConsumerSiteUsers]
'IX_Users_UserName'. Only a single key or unique index may be specified.
Since I am using the /ignoremissing and /ignoreadditional I cannot use a project file. I have 125 tables in my DB, so excluding them all (except 'users') isn't a great option either
Any assistance you may offer would be greatly appreciated.
I'm attempting to synch a single table named Users. I am using an index named 'IX_Users_UserName' which is not the primary key, but it is unique. The problem I am running into is that when attempting to synch the 'users' table, there is another table named 'ConsumerSiteUsers'. I can't seem to exclude this table from my comparrisons. (Because it has 'users' in it's table name)
Here is my syntax.
SQLDataCompare.exe /s1 laptop /s2 laptop /db1 Source /db2 Destination /ck:users:IX_Users_UserName /include:Table:\[Users] /exclude:Table:\[ConsumerSiteUsers] /comparisonkeys:users:username /options:d /cols:users:RoleID,DateCreated,DateLastChangedPassword,DateLastLoggedOn,username,userNameIsEmail,FirstName,LastName,PhoneNumber,PhoneExtension,DateLastVerifiedEmail,EmployeeNum,WizardEnable,DateLocked,PasswordHash,Salt,SecretQuestionID,SecretAnswer /v /ignoremissing /ignoreadditional
There are 2 colums in this table that I cannot replicate. Hence why I'm using an index key 'IX_Users_UserName, and specifying 18 of the columns.
Below is the error I receive:
Error: Invalid comparison keys specified for [dbo].[ConsumerSiteUsers]
'IX_Users_UserName'. Only a single key or unique index may be specified.
Since I am using the /ignoremissing and /ignoreadditional I cannot use a project file. I have 125 tables in my DB, so excluding them all (except 'users') isn't a great option either
Any assistance you may offer would be greatly appreciated.
This discussion has been closed.
Comments
If i could figure out how to save these settings within project , I'd be okay with this option too. I need to launch this synch on a scheduled basis, so finding a way to persist these settings is key.
I think the problem is due to you using square brackets around the object names. This is because in regular expressions it will act almost like a wildcard, thus including any table with users in the name.
Can you try without the square brackets and a hat (^) at the beginning to make the table name start with users. You may also try a dollar sign ($) at the end to signify the end.
Have a look at: http://en.wikipedia.org/wiki/Regular_expression for more information about using regular expressions.
Regards
Dan
Red Gate Software Ltd