Script File Encoding is Changed During Synchronisation
Chris Howarth
Posts: 8
We've hit a problem with SQL Compare 7.1 whereby the encoding of the updated scripts contained in a source folder is changed from UTF-16 to Windows-1252 during the synchronisation process.
We're currently attempting to synchronise our (mostly UTF-16, but some Windows-1252) scripts (held in TFS but checked-out to a folder) with a live database as the two have gradually drifted out of synch. Once the script files have been updated by SQL Compare it is then no longer possible to compare the TFS server version with the workspace version (i.e. the script updated by SQL Compare) as the encoding changes to Windows-1252 during synchronisation.
Is this a bug / feature of SQL Compare? Is there an option that allows the retention of the target scripts' encoding?
Thanks
Chris
We're currently attempting to synchronise our (mostly UTF-16, but some Windows-1252) scripts (held in TFS but checked-out to a folder) with a live database as the two have gradually drifted out of synch. Once the script files have been updated by SQL Compare it is then no longer possible to compare the TFS server version with the workspace version (i.e. the script updated by SQL Compare) as the encoding changes to Windows-1252 during synchronisation.
Is this a bug / feature of SQL Compare? Is there an option that allows the retention of the target scripts' encoding?
Thanks
Chris
Comments
The encoding of the SQL Scripts is set via the Tools menu ->Application Options ->Saving SQL Scripts section. There is a drop down box called 'Encoding'. The 4 possible options are:
UTF-8
UTF-8 with pre-amble
Unicode
ASCII
Is the database you are synchronizing too using a different collation or case sensitive collations?
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com
Thanks for your response.
I've previously tried amending the setting that you reference in your reply, but the setting only seems to affect the encoding of the single synchronisation script that SQL Compare generates when the requirement is to synchronise a database with another database or script folder.
I'm using SQL Compare the other way round, i.e. to update a set of existing scripts as a result of a comparison between a database and folder containing the scripts that I wish to update. The scripts are encoded as UTF-16, yet the encoding of the files is changed to Windows-1252 when SQL Compare has completed synchronisation, regardless of the setting of the 'Saving SQL Scripts -> Encoding' option. Ideally I'd like to retain the encoding of the original scripts.
Thanks
Chris
Unfortunately we do not have a workaround for this problem.
Therefore I have added your call details to an existing enhancement request to be able to set the encoding when saving or synchronizing to a scripts folder. The reference for this enhancement request is SC-3999.
Hopefully this option will appear in the next release of SQL Compare.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com
If possible (from our perspective at least) it would be preferable to retain the original encoding of each individual file (particularly as the encoding could vary between files in the same folder), but I guess that the ability to be able to specify the encoding would also be useful for the scenario where SQL Compare generates a new script for an object that exists in the database but does not exist in the folder.
Thanks
Chris