Sunday, March 25, 2012

Collation Error

Hi All,
Iam facing a problem with sql collations.
Problem:
I have a sproc1 residing on DB1 Database which makes a call to sproc2
on DB2 database.
The out params from sproc2 are processed inside sproc1. And the sproc1
is erroring out.
DB1 - SQL_Latin1_General_CP1_CI_AS Collation
DB2 - Japanese_CI_AS_KS_WS Collation
sproc1 Code:
declare @.name varchar(50)
SELECT @.Cmd = @.Server+'.'+@.Database+'.dbo.SPROC2 '
EXEC @.cmd @.name OUT
Error:
Server: Msg 446, Level 16, State 9, Line 1
Cannot resolve collation conflict for equal to operation.
With Regards,
Anandyou ought change that collation in DB2 and put on as in DB1.
"Anand" wrote:

> Hi All,
> Iam facing a problem with sql collations.
> Problem:
> I have a sproc1 residing on DB1 Database which makes a call to sproc2
> on DB2 database.
> The out params from sproc2 are processed inside sproc1. And the sproc1
> is erroring out.
> DB1 - SQL_Latin1_General_CP1_CI_AS Collation
> DB2 - Japanese_CI_AS_KS_WS Collation
> sproc1 Code:
> declare @.name varchar(50)
> SELECT @.Cmd = @.Server+'.'+@.Database+'.dbo.SPROC2 '
> EXEC @.cmd @.name OUT
> Error:
> Server: Msg 446, Level 16, State 9, Line 1
> Cannot resolve collation conflict for equal to operation.
> With Regards,
> Anand|||Can you post sproc2's code?
See "collate" clause in BOL.
AMB
"Anand" wrote:

> Hi All,
> Iam facing a problem with sql collations.
> Problem:
> I have a sproc1 residing on DB1 Database which makes a call to sproc2
> on DB2 database.
> The out params from sproc2 are processed inside sproc1. And the sproc1
> is erroring out.
> DB1 - SQL_Latin1_General_CP1_CI_AS Collation
> DB2 - Japanese_CI_AS_KS_WS Collation
> sproc1 Code:
> declare @.name varchar(50)
> SELECT @.Cmd = @.Server+'.'+@.Database+'.dbo.SPROC2 '
> EXEC @.cmd @.name OUT
> Error:
> Server: Msg 446, Level 16, State 9, Line 1
> Cannot resolve collation conflict for equal to operation.
> With Regards,
> Anand|||Both the databases resides in different servers.
As the collation is mandatory in both the databases we cannot change the
collation on both DB1 or DB2.
Is there any options without changing the collations?
"Enric" wrote:
> you ought change that collation in DB2 and put on as in DB1.
> "Anand" wrote:
>|||To change the collation at table/field level it could work, i don't know but
in any case, we would need see that sp.
Thanks and regards,
"Anand" wrote:
> Both the databases resides in different servers.
> As the collation is mandatory in both the databases we cannot change the
> collation on both DB1 or DB2.
> Is there any options without changing the collations?
> "Enric" wrote:
>|||sproc2:
create procedure sproc2
@.name varchar(50) output
As
Begin
Select @.name = name from table1
End
Note:
The sprocs are working fine with same collation as
SQL_Latin1_General_CP1_CI_AS
"Alejandro Mesa" wrote:
> Can you post sproc2's code?
> See "collate" clause in BOL.
>
> AMB
> "Anand" wrote:
>

No comments:

Post a Comment