SQLCompare Not Synchronizing Databases
cd "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE"
tf get "D:\Development\Spikes\TFS Test Project\Database" /version:T /recursive
cd "C:\Program Files (x86)\Red Gate\SQL Compare 8"
del /Q /F "C:\Temp\SchemaDiffReport_images\*.*"
sqlcompare /scr1:"D:\Development\Spikes\TFS Test Project\Database" /s2:MYDESKTOP\SQL2008 /UserName2:sa /p2:password /db2:TFSTest /o:Default /Report:"C:\Temp\SchemaDiffReport.html" /ReportType:Interactive /ScriptFile:"C:\Temp\SchemaSyncScript.sql" /sync /force /include:Table
When I run the batch file above I get this output from SQLCompare:
Registering data sources
Applying Command Line Items
Error: The selected objects are identical or no objects have been selected in the comparison.
But there is no User table in the TFSTest database.
I have checked the SQL in the Table subfolder in my Database folder and there is a file present that contains a script to create the User table. Is there something more I can check to see why the table is not getting created in the target database?
Your documents have been very helpful in setting up this process. I have run into a couple of issues with the example batch file listed in the continuous integration PDF. These are the changes/issues I found while working the example batch file provided.
The "Red Gate" folder is created in "C:\Program Files (x86)" instead of "C:\Program Files"
The tf get command needs the /recursive switch
SQLCompare needs the switch /force to overwrite the report files, however this still fails because /force doesn't force the deletion of images in the SchemaDiffReport_images folder
SQLCompare needs the switch /include
I ran cross documentation on your web site that says synchronization flows from database 2 to database 1. I can't remember now where I saw that. But SQLCompare reports the direction is from 1 to 2.