by Scott.Pearce » Wed Oct 21, 2015 4:52 pm
We try to be collation-agnostic where possible, hence our use of "Collate Database Default". You should get in the habit of doing this also, wherever you find yourself defining temp tables.
One trick I've used before is to use "memory tables" instead of "temp tables" in stored procedures - as the name implies, memory tables are created in memory so they don't use tempdb and therefore don't run the risk violating collation across databases. Memory tables are pretty fast if the server has the RAM, but the downside is that you cannot define indexes on them as you can with normal temp tables (at least you couldn't last time I checked).
There are third-party tools out there that will generate scripts to change a database's collation, and a quick google search reveals a bunch of promising hits. I remember playing with some of these years ago and found their output to be a bit hit-and-miss. The tend to work by scripting everything out, and sometimes they miss attributes.
Maybe some other forum users out there have some suggestions or stories regarding collation?
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials