views:

73

answers:

1

I have a collation conflict in a stored procedure I am trying to run to send it live... it has been explained here

http://stackoverflow.com/questions/1519544/sql-server-2000-dts-cannot-resolve-collation-conflict-for-equal-to-operation

Is there a way to fix the issue without writing the COLLATE database_default next to every problem equals comparison and do some sort of global command or setting? Or maybe there are some options when generating the scripts to have the collation tags pre done?

+1  A: 

There's no global command/setting, I'm afraid.

If you're generating scripts for objects from Enterprise Manager, it will automatically include the column collation for the individual columns which are possibly the cause of your error. You could then perhaps do a find/replace on those. But if you're just running a query joining data from two databases with objects using different collations, then it's more complicated. Including temporary tables might even introduce a third collation into the mix.
Basically, the COLLATE database_default option is the quick way of doing things. The slow way is updating everything to have the same collation.

There's some good info in these two articles, including instructions on how to change collations on existing objects.

Beware-of-Mixing-Collation-with-SQL-Server-2000---Part-1
Beware-of-Mixing-Collations-Part-2---Converting-Collations

CodeByMoonlight