Comments
Sort by recent activity
In the end I worked around the limitation by replacing the project file with lots of command-line switches and other tools.
I used TortoiseSVN's command-line svn client to export the database schema from the repository, and then used SQLCompare.exe to compare the script directory to the target database and exclude the unwanted objects.
The commands look like this: svn export http://svn.cloudcorp.com/database/trunk/GeoDB GeoDB
SQLCompare /scr1:GeoDB /server2:LOGSERVER /database2:GeoDB /exclude:All:sp_MS* /exclude:Schema:offline_*
The output of SQLCompare.exe now shows that the schemas are identical: SQL Compare: activated, edition: professional, serial number: REDACTED
SQL Compare Command Line V10.4.8.87
==============================================================================================
Copyright © Red Gate Software Ltd 1999-2013
Registering data sources
Creating mappings
Comparing
Applying Command Line Items
Retrieving migration scripts
Checking for identical databases
Error: The selected objects are identical or no objects have been selected in the comparison.
It's surprising and a little frustrating that SQLCompare.exe does not parse all the data in the project file. It means I can't use the project file to drive scripted deployments in my multi-server environment.
Is there a possibility that the behavior of the command-line version will be upgraded to match that of GUI version? / comments
In the end I worked around the limitation by replacing the project file with lots of command-line switches and other tools.
I used TortoiseSVN's command-line svn client to export the database schem...
Filter File Workaround (failed)
I used the GUI to save the filters to a seperate file called excludereplication.scpf.
I passed the filter file and project file to SQLCompare.exe using a command line like this: SQLCompare.exe /project:"deploy_geodb_schema_from_repo.scp" /filter:excludereplication.scpf
The output was the same - 59 differences. Exclude Switch Workaround (failed)
I added an exclude switch to the command line to exclude all objects whose names begin 'sp_MS': SQLCompare.exe /project:"deploy_geodb_schema_from_repo.scp" /exclude:object:sp_MS*
The output looks like this: SQL Compare: activated, edition: professional, serial number: REDACTED
SQL Compare Command Line V10.4.8.87
==============================================================================================
Copyright © Red Gate Software Ltd 1999-2013
Error: The /project switch cannot be used in conjunction with the /exclude switch.
I can't combine the /exclude switch with the /project switch at all. / comments
Filter File Workaround (failed)
I used the GUI to save the filters to a seperate file called excludereplication.scpf.
I passed the filter file and project file to SQLCompare.exe using a command lin...
I think the deprecated file is RedGateDatabaseInfo.xml.
Perhaps the second informational message should instead look like this:
Severity: Information
Title: If using source control you can delete deprecated XML File C:\fakepath\WidgetDB\RedGateDatabaseInfo.xml from the repository
Am I correct to assume that RedGateDatabaseProperties.xml is a replacement for RedGateDatabaseInfo.xml?
Perhaps just one informational message explaining that one file is to replace the other would be more helpful.
My local scripts folder is also an svn working copy. I used the svn status command to show all the changes made by SQL Source Control. The output looks like this:
C:\fakepath\WidgetDB>svn status
! RedGateDatabaseInfo.xml
? Stored Procedures\dbo.uspWidgetDelete.sql
? RedGateDatabaseProperties.xml
The output shows that SQL Compare created two new files, Stored Procedures\dbo.uspWidgetDelete.sql and RedGateDatabaseProperties.xml, and deleted one file, RedGateDatabaseInfo.xml.
The .sql file represents the change I intended to make, and the .xml files are metadata for the Red Gate tools. / comments
I think the deprecated file is RedGateDatabaseInfo.xml.
Perhaps the second informational message should instead look like this:
Severity: Information
Title: If using source control you can delete ...
Also ignore my second comment.
I misread the SSMS script.
I just realized that IGNORE_DUP_KEY = OFF is the default setting.
Never mind!
Thanks for your help, Brian! / comments
Also ignore my second comment.
I misread the SSMS script.
I just realized that IGNORE_DUP_KEY = OFF is the default setting.
Never mind!
Thanks for your help, Brian!
Thanks for investigating, Brian.
This is academic now, because I can no longer reproduce the original problem after I synchronizing the object using Management Studio.
However, your attempt to reproduce the problem still demonstrates that SQL Compare does not correctly script out the user-defined table type.
In the Management Studio script, the primary key is declared like this: PRIMARY KEY CLUSTERED ([id])
(
[id] ASC
)WITH (IGNORE_DUP_KEY = OFF)
/ comments
Thanks for investigating, Brian.
This is academic now, because I can no longer reproduce the original problem after I synchronizing the object using Management Studio.
However, your attempt to repr...
Thanks for investigating, Brian.
This is academic now, because I can no longer reproduce the original problem after I synchronizing the object using Management Studio.
You can close the original issue as 'not reproducible'.
However, your attempt at reproducing the problem still indicates a problem with how SQL Compare handles user-defined table types.
I'll start a new thread to focus on the new issue.
Please ignore my last post. I hit 'Submit' instead of 'Preview'. / comments
Thanks for investigating, Brian.
This is academic now, because I can no longer reproduce the original problem after I synchronizing the object using Management Studio.
You can close the original is...
You can use Red Gate's SQL Source Control plugin for Management Studio to fix this:
1) Remove (svn delete) the static data file from version control.
2) In Object Explorer, right-click on the table containing the static data, and choose 'Other SQL Source Control Tasks', and then 'Link/Unlink Static Data'. [image]
3) A list of tables should appear with a check next to your static data table. Click 'Save and Close'. [image] If no check mark appears, you may have to add a primary key to the table first.
4) Go to the main SQL Source Control tab and view the Commit Changes tab. Commit the new 'Data Link' change type to check in the static data. [image]
After the commit succeeds, your data will be under version control as before. Additionally, changes to the data will be automatically detected by SQL Source Control and it will prompt you to commit these data changes.
And, of course, SQL Source control will no longer issue 'Non-schema statement was ignored' warnings! At the SQL In The City conference in London last month, I had the opportunity to discuss this directly with one of the developers. He explained that the data file set is defined not by the content of the Data directory alone but also by the <DataFileSet> section of the file RedGateDatabaseInfo.xml. Any file in the Data directory not also listed in this XML file will be parsed as a schema file instead of a data file. Thanks for your help, Red Gate! / comments
You can use Red Gate's SQL Source Control plugin for Management Studio to fix this:
1) Remove (svn delete) the static data file from version control.
2) In Object Explorer, right-click on the table...
Thanks for your reply, peter.peart. I would have got back to you sooner, but I wasn't receiving alerts for replies to my post.
The warnings appear when I re-create the project file. I follow these steps reproduce the issue:
Start SQL Compare.
Create a new project.
In the Data Sources tab, configure Source like this:
Source Control
Direct from source control
Repository:
[url=svn://svn.example.com/ExampleDatabase]svn://svn.example.com/ExampleDatabase[/url]
Version: Latest (Head)
And configure Target like this:
Server: (local)
Windows Authentication
Database: ExampleDatabase
In the Options tab, uncheck all options except 'Whitespace'.
Run the comparison.
During the 'Registering data sources' step, the 'Error Parsing Scripts' dialog appears: [image] / comments
Thanks for your reply, peter.peart. I would have got back to you sooner, but I wasn't receiving alerts for replies to my post.
The warnings appear when I re-create the project file. I follow these ...