SQL Data Compare switches culture and not switches back
knoxi
Posts: 5
Hi
We use the compare and data compare component of Red Gate.
We have updated all components of Red Gate in our applications two weeks ago to version 8.
Now we have perceived that the Data Compare component switches the culture of the running assembly to english and not switches back right.
System:
Windows XP SP3 German
VS2008
RedGate Compare & DataCompare newest version 8.x
Regards,
Demian
We use the compare and data compare component of Red Gate.
We have updated all components of Red Gate in our applications two weeks ago to version 8.
Now we have perceived that the Data Compare component switches the culture of the running assembly to english and not switches back right.
System:
Windows XP SP3 German
VS2008
RedGate Compare & DataCompare newest version 8.x
Regards,
Demian
Comments
Are you refering to the date format setting at the start of the script?
SET DATEFORMAT YMD
GO
If so, then this is just the dateformat for the session and will only be used for this one script. It doesn't need to be set back afterwards as it is only used for the session.
This session setting was added to the script in SQL Data comapre 8, to get round a problem where the dateformat for certain cultures wasn't properly scripted.
I hope this helps explain.
No, I don't mean the SQL Server script, I mean the .NET assemly thread culture 'Threading.Thread.CurrentThread.CurrentCulture'.
At the start of the program, the culture of 'Threading.Thread.CurrentThread.CurrentCulture' is set to 'de-CH', and when I pass the follow code block
then the culture of the assembly thread 'Threading.Thread.CurrentThread.CurrentCulture' has changed on execute 'CompareDatabases' in row '11: ...' to 'invariant culture'.
After that, the assemlby thread has an invalid culture to continue work, which will not set back by RedGate components.
Can you tell us why this appears?
Regards,
Demian
I've been able to reproduce this now, so I've logged it as a bug with the API (CSD-127).
As a workaround for the time being, you could reset the culture immediatly after CompareDatabases e.g.
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-CH");
I hope this helps.
I'll let you know if we get a patch out that fixes this problem.
Thanks for your feedback.
We have already implemented this workaround. But it would be better to solve it with fixed components.
Thanks for your efforts.
Regards,
Demian
This is now fixed in the latest SQL Data compare engine.
You can download the patch for SQL Data compare here.
Or the updated SDK with the new SQL Data compare engine here.
I hope this helps.
It is fixed in this release:
but not in the release here:
Regards,
Demian