A SQL script I am writing is generating the error:
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "SQL_Latin1_General_CP850_CI_AS" in the equal to operation.
I am not familiar with this error and don't know how to deal with it. I have been able to determine it is caused by the last IF check in the script as once I remove it the script runs fine. Can anyone help me figure out how to fix this issue? Here is my current code:
DECLARE @Source varchar(25);
SET @Source = 'DOD';
/*
Source options are:
DOD
SPRAGUEENERGY
SRAPROD
*/
IF (@Source = 'DOD')
BEGIN
USE DOD;
END
IF(@Source = 'SPRAGUEENERGY')
BEGIN
USE SPRAGUEENERGY;
END
IF (@Source = 'SRAPROD')
BEGIN
USE SRAPROD;
END