PDA

View Full Version : Cannot resolve the collation conflict between "Arabic_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in t



Sal_64
جمعه 04 مرداد 1392, 18:59 عصر
سلام واسه کوئری زیر این خطا میده
کسی میدونه چرا ؟!

متن کامل خطا و کوئری


Cannot resolve the collation conflict between "Arabic_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.
@noa_bodge varchar(50),
@date_b varchar(15),
@date_e varchar(15)


as
if(@noa_bodge='1')
begin
select
d1.code_tarh,
d1.shomare_name,
d1.sharh_onvan,
d1.sharh_j_0,
d1.kol_pardakhti,
d1.shomare_hesab,
d1.bank,
d2.tan_variz
from
(
select crdit.code_onvan,code_tarh,shomare_name ,
(select sharh from onvan where code=crdit.code_onvan) as sharh_onvan,
(select sharh from jari where code=crdit.code_onvan) as sharh_j_0,
kol_pardakhti,
(select name_bank+'_'+shoabe_bank from hesab where code_onvan=crdit.code_onvan)as bank,
(select shomare_hesab from hesab where code_onvan=crdit.code_onvan)as shomare_hesab
from crdit
where noa_bodge=@noa_bodge and
tarikh_sabt between @date_b and @date_e
)d1 left join
(
select tankhah.code_onvan ,variz as tan_variz
from tankhah
where noa_bodge=@noa_bodge and
tarikh_sabt between @date_b and @date_e
)d2 on d1.code_onvan =d2.code_onvan

end
else if(@noa_bodge='2')
begin
select
d1.code_tarh,
d1.shomare_name,
d1.sharh_onvan,
d1.sharh_j_0,
d1.kol_pardakhti,
d1.shomare_hesab,
d1.bank,
d2.tan_variz
from
(
select crdit.code_onvan,code_tarh,shomare_name ,
(select sharh from onvan where code=crdit.code_onvan) as sharh_onvan,
(select sharh from omrani where code=crdit.code_onvan) as sharh_j_0,
kol_pardakhti,
(select name_bank+'_'+shoabe_bank from hesab where code_onvan=crdit.code_onvan)as bank,
(select shomare_hesab from hesab where code_onvan=crdit.code_onvan)as shomare_hesab
from crdit
where noa_bodge=@noa_bodge and
tarikh_sabt between @date_b and @date_e
)d1 left join
(
select tankhah.code_onvan ,variz as tan_variz
from tankhah
where noa_bodge=@noa_bodge and
tarikh_sabt between @date_b and @date_e
)d2 on d1.code_onvan =d2.code_onvan

end


RETURN

Sal_64
جمعه 04 مرداد 1392, 22:47 عصر
پاسخ :
COLLATE فیلدهای تیبل های استفاده شده در این sp از یک نوع نبودن و به همین دلیل خطای بالا بوقوع می پیوست
با یکسان سازیشون مشکل رفع شد

hamcker
یک شنبه 10 خرداد 1394, 13:42 عصر
میتونید از کد زیر استفاده کنید:

SELECT * FROM TableA
JOIN TableB ON TableA.F1 COLLATE Detabase_Default = TableB.F1 COLLATE Database_Default