Showing posts with label conflict. Show all posts
Showing posts with label conflict. Show all posts

Friday, February 10, 2012

Cannot resolve the collation conflict.

Hello everybody,

I need help urgently.

After upgraded my sql server to SP2, i have this problem:

Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AI" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.

Why? any solution?

best reguards

It would be useful to know the context in which this error occurs:

When running certain queries?

Cannot resolve the collation conflict between

Hi
Your report's query contains JOIN on varchar/nvarchar columns which have
different collation
Try
select * from table join anothertable on table.col =anothertable.column
COLLATE danish_norwegian_ci_as
"H.Gjerde" <hg@.norspace.no> wrote in message
news:%23zJ%23Lv5PHHA.2468@.TK2MSFTNGP06.phx.gbl...
> Hi
> I have a new DB, in this new DB I have import and copy some data from the
> old DB, among others, a report
> When i try to open the report, I get this message
> - Cannot resolve the collation conflict between
> "SQL_Latin1_General_CP1_CI_AS" and "danish_norwegian_ci_as" in the equal
>
> Any ideas.
> Thanks
>
Hi
I have no idea. I don't know Crystal Report
"H.Gjerde" <hg@.norspace.no> wrote in message
news:eeyQ5F6PHHA.3344@.TK2MSFTNGP02.phx.gbl...
> Thank you
> It help, in my plain sql script
> But I stil have the problem, because I not realy sure where to put it in
> my CrystalReport. The report is predefined.
> ...? :|
>
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:uHN$g25PHHA.3268@.TK2MSFTNGP03.phx.gbl...
>
|||can you create SP and call it in Crystal Report
Regards
Amish shah
http://shahamishm.tripod.com
On Jan 24, 3:31 pm, "Uri Dimant" <u...@.iscar.co.il> wrote:[vbcol=seagreen]
> Hi
> I have no idea. I don't know Crystal Report
> "H.Gjerde" <h...@.norspace.no> wrote in messagenews:eeyQ5F6PHHA.3344@.TK2MSFTNGP02.phx.gbl. ..
>
>
>
>

Cannot resolve the collation conflict between

Hi
I have a new DB, in this new DB I have import and copy some data from the
old DB, among others, a report
When i try to open the report, I get this message
- Cannot resolve the collation conflict between
"SQL_Latin1_General_CP1_CI_AS" and "danish_norwegian_ci_as" in the equal
Any ideas.
ThanksHi
Your report's query contains JOIN on varchar/nvarchar columns which have
different collation
Try
select * from table join anothertable on table.col =anothertable.column
COLLATE danish_norwegian_ci_as
"H.Gjerde" <hg@.norspace.no> wrote in message
news:%23zJ%23Lv5PHHA.2468@.TK2MSFTNGP06.phx.gbl...
> Hi
> I have a new DB, in this new DB I have import and copy some data from the
> old DB, among others, a report
> When i try to open the report, I get this message
> - Cannot resolve the collation conflict between
> "SQL_Latin1_General_CP1_CI_AS" and "danish_norwegian_ci_as" in the equal
>
> Any ideas.
> Thanks
>|||Thank you
It help, in my plain sql script
But I stil have the problem, because I not realy sure where to put it in my
CrystalReport. The report is predefined.
...? :|
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uHN$g25PHHA.3268@.TK2MSFTNGP03.phx.gbl...
> Hi
> Your report's query contains JOIN on varchar/nvarchar columns which have
> different collation
> Try
> select * from table join anothertable on table.col =anothertable.column
> COLLATE danish_norwegian_ci_as
>
>
> "H.Gjerde" <hg@.norspace.no> wrote in message
> news:%23zJ%23Lv5PHHA.2468@.TK2MSFTNGP06.phx.gbl...
>> Hi
>> I have a new DB, in this new DB I have import and copy some data from the
>> old DB, among others, a report
>> When i try to open the report, I get this message
>> - Cannot resolve the collation conflict between
>> "SQL_Latin1_General_CP1_CI_AS" and "danish_norwegian_ci_as" in the equal
>>
>> Any ideas.
>> Thanks
>|||Hi
I have no idea. I don't know Crystal Report
"H.Gjerde" <hg@.norspace.no> wrote in message
news:eeyQ5F6PHHA.3344@.TK2MSFTNGP02.phx.gbl...
> Thank you
> It help, in my plain sql script
> But I stil have the problem, because I not realy sure where to put it in
> my CrystalReport. The report is predefined.
> ...? :|
>
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:uHN$g25PHHA.3268@.TK2MSFTNGP03.phx.gbl...
>> Hi
>> Your report's query contains JOIN on varchar/nvarchar columns which have
>> different collation
>> Try
>> select * from table join anothertable on table.col =anothertable.column
>> COLLATE danish_norwegian_ci_as
>>
>>
>> "H.Gjerde" <hg@.norspace.no> wrote in message
>> news:%23zJ%23Lv5PHHA.2468@.TK2MSFTNGP06.phx.gbl...
>> Hi
>> I have a new DB, in this new DB I have import and copy some data from
>> the old DB, among others, a report
>> When i try to open the report, I get this message
>> - Cannot resolve the collation conflict between
>> "SQL_Latin1_General_CP1_CI_AS" and "danish_norwegian_ci_as" in the equal
>>
>> Any ideas.
>> Thanks
>>
>|||can you create SP and call it in Crystal Report
Regards
Amish shah
http://shahamishm.tripod.com
On Jan 24, 3:31 pm, "Uri Dimant" <u...@.iscar.co.il> wrote:
> Hi
> I have no idea. I don't know Crystal Report
> "H.Gjerde" <h...@.norspace.no> wrote in messagenews:eeyQ5F6PHHA.3344@.TK2MSFTNGP02.phx.gbl...
>
> > Thank you
> > It help, in my plain sql script
> > But I stil have the problem, because I not realy sure where to put it in
> > my CrystalReport. The report is predefined.
> > ...? :|
> > "Uri Dimant" <u...@.iscar.co.il> wrote in message
> >news:uHN$g25PHHA.3268@.TK2MSFTNGP03.phx.gbl...
> >> Hi
> >> Your report's query contains JOIN on varchar/nvarchar columns which have
> >> different collation
> >> Try
> >> select * from table join anothertable on table.col =anothertable.column
> >> COLLATE danish_norwegian_ci_as
> >> "H.Gjerde" <h...@.norspace.no> wrote in message
> >>news:%23zJ%23Lv5PHHA.2468@.TK2MSFTNGP06.phx.gbl...
> >> Hi
> >> I have a new DB, in this new DB I have import and copy some data from
> >> the old DB, among others, a report
> >> When i try to open the report, I get this message
> >> - Cannot resolve the collation conflict between
> >> "SQL_Latin1_General_CP1_CI_AS" and "danish_norwegian_ci_as" in the equal
> >> Any ideas.
> >> Thanks- Hide quoted text -- Show quoted text -|||H.Gjerde wrote:
> Hi
> I have a new DB, in this new DB I have import and copy some data from the
> old DB, among others, a report
> When i try to open the report, I get this message
> - Cannot resolve the collation conflict between
> "SQL_Latin1_General_CP1_CI_AS" and "danish_norwegian_ci_as" in the equal
>
> Any ideas.
> Thanks
>
Hi
The new database you have created, seems to be created with a different
collation than the old one. If you can't change the SQL code behind the
report, your best option might be to drop the new database, create a new
one with the correct collation and then import the data again.
--
Regards
Steen Schlüter Persson
Database Administrator / System Administrator|||you might find that it is in fact the tempdb has a different collation
than the user database. You might have to rebuild the system databases
using "rebuildm".
On Jan 24, 11:30 am, "Steen Schl=FCter Persson (DK)"
<steen@.REMOVE_THIS_asavaenget.dk> wrote:
> H.Gjerde wrote:
> > Hi
> > I have a new DB, in this new DB I have import and copy some data from t=he
> > old DB, among others, a report
> > When i try to open the report, I get this message
> > - Cannot resolve the collation conflict between
> > "SQL_Latin1_General_CP1_CI_AS" and "danish_norwegian_ci_as" in the equal
> > Any ideas.
> > ThanksHi
> The new database you have created, seems to be created with a different
> collation than the old one. If you can't change the SQL code behind the
> report, your best option might be to drop the new database, create a new
> one with the correct collation and then import the data again.
> --
> Regards
> Steen Schl=FCter Persson
> Database Administrator / System Administrator

Cannot resolve the collation conflict between

Hi
I have a new DB, in this new DB I have import and copy some data from the
old DB, among others, a report
When i try to open the report, I get this message
- Cannot resolve the collation conflict between
"SQL_Latin1_General_CP1_CI_AS" and "danish_norwegian_ci_as" in the equal
Any ideas.
ThanksHi
Your report's query contains JOIN on varchar/nvarchar columns which have
different collation
Try
select * from table join anothertable on table.col =anothertable.column
COLLATE danish_norwegian_ci_as
"H.Gjerde" <hg@.norspace.no> wrote in message
news:%23zJ%23Lv5PHHA.2468@.TK2MSFTNGP06.phx.gbl...
> Hi
> I have a new DB, in this new DB I have import and copy some data from the
> old DB, among others, a report
> When i try to open the report, I get this message
> - Cannot resolve the collation conflict between
> "SQL_Latin1_General_CP1_CI_AS" and "danish_norwegian_ci_as" in the equal
>
> Any ideas.
> Thanks
>|||Thank you
It help, in my plain sql script
But I stil have the problem, because I not realy sure where to put it in my
CrystalReport. The report is predefined.
...? :|
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uHN$g25PHHA.3268@.TK2MSFTNGP03.phx.gbl...
> Hi
> Your report's query contains JOIN on varchar/nvarchar columns which have
> different collation
> Try
> select * from table join anothertable on table.col =anothertable.column
> COLLATE danish_norwegian_ci_as
>
>
> "H.Gjerde" <hg@.norspace.no> wrote in message
> news:%23zJ%23Lv5PHHA.2468@.TK2MSFTNGP06.phx.gbl...
>|||Hi
I have no idea. I don't know Crystal Report
"H.Gjerde" <hg@.norspace.no> wrote in message
news:eeyQ5F6PHHA.3344@.TK2MSFTNGP02.phx.gbl...
> Thank you
> It help, in my plain sql script
> But I stil have the problem, because I not realy sure where to put it in
> my CrystalReport. The report is predefined.
> ...? :|
>
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:uHN$g25PHHA.3268@.TK2MSFTNGP03.phx.gbl...
>|||can you create SP and call it in Crystal Report
Regards
Amish shah
http://shahamishm.tripod.com
On Jan 24, 3:31 pm, "Uri Dimant" <u...@.iscar.co.il> wrote:[vbcol=seagreen]
> Hi
> I have no idea. I don't know Crystal Report
> "H.Gjerde" <h...@.norspace.no> wrote in messagenews:eeyQ5F6PHHA.3344@.TK2MSF
TNGP02.phx.gbl...
>
>
>
>
>
>
>
>|||H.Gjerde wrote:
> Hi
> I have a new DB, in this new DB I have import and copy some data from the
> old DB, among others, a report
> When i try to open the report, I get this message
> - Cannot resolve the collation conflict between
> "SQL_Latin1_General_CP1_CI_AS" and "danish_norwegian_ci_as" in the equal
>
> Any ideas.
> Thanks
>
Hi
The new database you have created, seems to be created with a different
collation than the old one. If you can't change the SQL code behind the
report, your best option might be to drop the new database, create a new
one with the correct collation and then import the data again.
Regards
Steen Schlter Persson
Database Administrator / System Administrator|||you might find that it is in fact the tempdb has a different collation
than the user database. You might have to rebuild the system databases
using "rebuildm".
On Jan 24, 11:30 am, "Steen Schl=FCter Persson (DK)"
<steen@.REMOVE_THIS_asavaenget.dk> wrote:
> H.Gjerde wrote:
>
he[vbcol=seagreen]
>
>
> The new database you have created, seems to be created with a different
> collation than the old one. If you can't change the SQL code behind the
> report, your best option might be to drop the new database, create a new
> one with the correct collation and then import the data again.
> --
> Regards
> Steen Schl=FCter Persson
> Database Administrator / System Administrator

Cannot resolve the collation conflict

Hi all,
I have this problem in my SQL 2K5 Server
Cannot resolve the collation conflict between
"SQL_Latin1_General_CP1250_CI_AS" and "Latin1_General_CI_AS" in the equal to
operation.
I can't solve this problem. I already try to change the data bases
collation, to Modern_spanish_CI_AS, but don′t solve my problem, but doesn'
t
apear any thing about my changes.
Some body told me to change the collation in the master database. But don′t
let me change because is a system data base.
What can I do I've been with this problem, 3 weeks. I don′t know wath can i
do more.
I'll be grateful if any one can help me.
Thanks ,
PedroPedro
Yep, it appears when you JOIN the tables ON columns that have VARCHAR
datatype and different collation . I think you did a RESTORE the database
which has different collation
SELECT <> FROM TableA A JOIN TableB B ON A.col=B.col COLLATE
SQL_Latin1_General_CP1250_CI_AS
Or you can change the COLLATION per even COLUMN in the table
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:FEF4B825-D7C0-4685-A4FC-33D828C59154@.microsoft.com...
> Hi all,
> I have this problem in my SQL 2K5 Server
> Cannot resolve the collation conflict between
> "SQL_Latin1_General_CP1250_CI_AS" and "Latin1_General_CI_AS" in the equal
> to
> operation.
> I can't solve this problem. I already try to change the data bases
> collation, to Modern_spanish_CI_AS, but dont solve my problem, but
> doesn't
> apear any thing about my changes.
> Some body told me to change the collation in the master database. But
> dont
> let me change because is a system data base.
> What can I do I've been with this problem, 3 weeks. I dont know wath can
> i
> do more.
> I'll be grateful if any one can help me.
> --
> Thanks ,
> Pedro|||Pedro wrote:
> Hi all,
> I have this problem in my SQL 2K5 Server
> Cannot resolve the collation conflict between
> "SQL_Latin1_General_CP1250_CI_AS" and "Latin1_General_CI_AS" in the equal
to
> operation.
> I can't solve this problem. I already try to change the data bases
> collation, to Modern_spanish_CI_AS, but don′t solve my problem, but does
n't
> apear any thing about my changes.
> Some body told me to change the collation in the master database. But don
t
> let me change because is a system data base.
> What can I do I've been with this problem, 3 weeks. I don′t know wath can
i
> do more.
> I'll be grateful if any one can help me.
>
Hi Pedro
Changing the collation for at database, will not change the collation
for the columns. To do this you'll have to use ALTER TABLE.
Instead of changing the collation on a column, you can also specify the
collation in your compare part of the statement that fails.
An example could be something like
SELECT Column1, Column2
FROM MyTable M
WHERE EXISTS (SELECT * FROM ThisTable T WHERE M.Column1 = T.Column1
COLLATE Latin1_General_CI_AS)
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator|||Hi,
Tanks for your rapid answers.
The tables of data bases where I change the collation are already in
Modern_Spanish_CI_AS collation, but what I saw is that collation don’t hav
e
nothing to do with the conflict.
With the collation in master DB I can’t change it, so when I try to change
any thing, said that I can’t change a system DB.
The unique way that I see to restore de DB is delete before Restore de Backu
p.
I must say to you this problem that I have is not in a Query that I made but
is on a Spanish compiled application. And give me this error.
These changes can be easy but I can’t see how to solve.
Thanks ,
Pedro
"Steen Persson (DK)" wrote:

> Pedro wrote:
> Hi Pedro
> Changing the collation for at database, will not change the collation
> for the columns. To do this you'll have to use ALTER TABLE.
> Instead of changing the collation on a column, you can also specify the
> collation in your compare part of the statement that fails.
> An example could be something like
> SELECT Column1, Column2
> FROM MyTable M
> WHERE EXISTS (SELECT * FROM ThisTable T WHERE M.Column1 = T.Column1
> COLLATE Latin1_General_CI_AS)
>
> --
> Regards
> Steen Schlüter Persson
> Databaseadministrator / Systemadministrator
>|||Pedro wrote:
> Hi,
> Tanks for your rapid answers.
> The tables of data bases where I change the collation are already in
> Modern_Spanish_CI_AS collation, but what I saw is that collation don’t h
ave
> nothing to do with the conflict.
> With the collation in master DB I can’t change it, so when I try to chan
ge
> any thing, said that I can’t change a system DB.
> The unique way that I see to restore de DB is delete before Restore de Bac
kup.
> I must say to you this problem that I have is not in a Query that I made b
ut
> is on a Spanish compiled application. And give me this error.
> These changes can be easy but I can’t see how to solve.
>
Hi Pedro
If the problem is within the Master database, you'll have to rebuild the
master table. Try to look up " Changing Collations" in Books On Line.
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator|||Hi Steen Persson,
I'm steel with the problem. I only answare now because i must reeinstall the
SQL SERVER 2005 to change the master collation to Modern_Spanish_CI_AS. But
I
steel with the same error. I already change all tables in the database to
that collation but I steel with Latin_Collation conflict.
I try to find where is going catch Latin_Collation, but without sucess.
All colations in SQL SERVER 2K5 are in Modern_Spanish_CI_AS.
What can I do?
Thanks ,
Pedro
"Steen Persson (DK)" wrote:

> Pedro wrote:
> Hi Pedro
> If the problem is within the Master database, you'll have to rebuild the
> master table. Try to look up " Changing Collations" in Books On Line.
>
> --
> Regards
> Steen Schlüter Persson
> Databaseadministrator / Systemadministrator
>|||Pedro wrote:
> Hi Steen Persson,
> I'm steel with the problem. I only answare now because i must reeinstall t
he
> SQL SERVER 2005 to change the master collation to Modern_Spanish_CI_AS. Bu
t I
> steel with the same error. I already change all tables in the database to
> that collation but I steel with Latin_Collation conflict.
> I try to find where is going catch Latin_Collation, but without sucess.
> All colations in SQL SERVER 2K5 are in Modern_Spanish_CI_AS.
> What can I do?
>
Hi Pedro
I think you'll have to supply us with some samples of the code that's
generating the problem. If you are sure that everything in on the server
is using the same collation, then it's strange that it gives you the error.
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator|||Hi Steen Persson,
I don′t have access to the application code, I only have access to the SQL
SRV 2K5 and it gives me this message.
************** Texto da excep??o **************
System.Data.SqlClient.SqlException: Cannot resolve the collation conflict
between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the
equal to operation.
****************************************
*************
BUT When i type this comand :
use Ven0
EXEC sp_help 'bparam'
It apears this collation in this Column:
Column_name Collation
TIPO_FAC Latin1_General_CI_AS
How can I change the collation in all columns?
Thanks ,
Pedro
"Steen Persson (DK)" wrote:

> Pedro wrote:
> Hi Pedro
> I think you'll have to supply us with some samples of the code that's
> generating the problem. If you are sure that everything in on the server
> is using the same collation, then it's strange that it gives you the error
.
>
> --
> Regards
> Steen Schlüter Persson
> Databaseadministrator / Systemadministrator
>|||Pedro wrote:
> Hi Steen Persson,
> I don′t have access to the application code, I only have access to the SQ
L
> SRV 2K5 and it gives me this message.
>
> ************** Texto da excep??o **************
> System.Data.SqlClient.SqlException: Cannot resolve the collation conflict
> between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the
> equal to operation.
> ****************************************
*************
> BUT When i type this comand :
> use Ven0
> EXEC sp_help 'bparam'
> It apears this collation in this Column:
> Column_name Collation
> TIPO_FAC Latin1_General_CI_AS
> How can I change the collation in all columns?
>
Hi Pedro
You will have to use the ALTER TABLE command to change the collation for
individual columns.
The command will be something like this (taken from BOL)
ALTER TABLE MyTable ALTER COLUMN CharCol varchar(10)COLLATE
Latin1_General_CI_AS NOT NULL
You'll just have to keep in mind that there are certain restrictions on
which columns you can or can't change (e.g. computed column, CHECK
constraint and FOREIGN key). You can look up the details in Books On
Line under "Setting and changing the column collation)
(ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/d7a9638b-717c-4680-9b98-884
9081e08be.htm
).
You should also make sure that your model database and tempdb are using
the desired collation. If the comparison that are causing the problem is
happaening against a temp table, then this table is created in tempdb
and it's then tempdb's collation that's being used. You can check/change
the collation for tempdb, but then you should also do it for the model
db, since it's the setting for model that are used to recreate temdb
when you restart the server.
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator

Cannot resolve the collation conflict

Hi all,
I have this problem in my SQL 2K5 Server
Cannot resolve the collation conflict between
"SQL_Latin1_General_CP1250_CI_AS" and "Latin1_General_CI_AS" in the equal to
operation.
I can't solve this problem. I already try to change the data bases
collation, to Modern_spanish_CI_AS, but don´t solve my problem, but doesn't
apear any thing about my changes.
Some body told me to change the collation in the master database. But don´t
let me change because is a system data base.
What can I do I've been with this problem, 3 weeks. I don´t know wath can i
do more.
I'll be grateful if any one can help me.
--
Thanks ,
PedroPedro
Yep, it appears when you JOIN the tables ON columns that have VARCHAR
datatype and different collation . I think you did a RESTORE the database
which has different collation
SELECT <> FROM TableA A JOIN TableB B ON A.col=B.col COLLATE
SQL_Latin1_General_CP1250_CI_AS
Or you can change the COLLATION per even COLUMN in the table
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:FEF4B825-D7C0-4685-A4FC-33D828C59154@.microsoft.com...
> Hi all,
> I have this problem in my SQL 2K5 Server
> Cannot resolve the collation conflict between
> "SQL_Latin1_General_CP1250_CI_AS" and "Latin1_General_CI_AS" in the equal
> to
> operation.
> I can't solve this problem. I already try to change the data bases
> collation, to Modern_spanish_CI_AS, but don´t solve my problem, but
> doesn't
> apear any thing about my changes.
> Some body told me to change the collation in the master database. But
> don´t
> let me change because is a system data base.
> What can I do I've been with this problem, 3 weeks. I don´t know wath can
> i
> do more.
> I'll be grateful if any one can help me.
> --
> Thanks ,
> Pedro|||This is a multi-part message in MIME format.
--070104050607020805070605
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Pedro wrote:
> Hi all,
> I have this problem in my SQL 2K5 Server
> Cannot resolve the collation conflict between
> "SQL_Latin1_General_CP1250_CI_AS" and "Latin1_General_CI_AS" in the equal to
> operation.
> I can't solve this problem. I already try to change the data bases
> collation, to Modern_spanish_CI_AS, but don´t solve my problem, but doesn't
> apear any thing about my changes.
> Some body told me to change the collation in the master database. But don´t
> let me change because is a system data base.
> What can I do I've been with this problem, 3 weeks. I don´t know wath can i
> do more.
> I'll be grateful if any one can help me.
>
Hi Pedro
Changing the collation for at database, will not change the collation
for the columns. To do this you'll have to use ALTER TABLE.
Instead of changing the collation on a column, you can also specify the
collation in your compare part of the statement that fails.
An example could be something like
SELECT Column1, Column2
FROM MyTable M
WHERE EXISTS (SELECT * FROM ThisTable T WHERE M.Column1 = T.Column1
COLLATE Latin1_General_CI_AS)
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator
--070104050607020805070605
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Pedro wrote:
<blockquote cite="midFEF4B825-D7C0-4685-A4FC-33D828C59154@.microsoft.com"
type="cite">
<pre wrap="">Hi all,
I have this problem in my SQL 2K5 Server
Cannot resolve the collation conflict between
"SQL_Latin1_General_CP1250_CI_AS" and "Latin1_General_CI_AS" in the equal to
operation.
I can't solve this problem. I already try to change the data bases
collation, to Modern_spanish_CI_AS, but don´t solve my problem, but doesn't
apear any thing about my changes.
Some body told me to change the collation in the master database. But don´t
let me change because is a system data base.
What can I do I've been with this problem, 3 weeks. I don´t know wath can i
do more.
I'll be grateful if any one can help me.
</pre>
</blockquote>
<font size="-1"><font face="Arial">Hi Pedro<br>
<br>
Changing the collation for at database, will not change the collation
for the columns. To do this you'll have to use ALTER TABLE. <br>
Instead of changing the collation on a column, you can also specify the
collation in your compare part of the statement that fails.<br>
<br>
An example could be something like <br>
<br>
SELECT Column1, Column2 <br>
FROM MyTable M<br>
WHERE EXISTS (SELECT * FROM ThisTable T WHERE M.Column1 = T.Column1
COLLATE Latin1_General_CI_AS) <br>
<br>
<br>
-- <br>
Regards<br>
Steen Schlüter Persson<br>
Databaseadministrator / Systemadministrator<br>
</font></font>
</body>
</html>
--070104050607020805070605--|||Hi,
Tanks for your rapid answers.
The tables of data bases where I change the collation are already in
Modern_Spanish_CI_AS collation, but what I saw is that collation donâ't have
nothing to do with the conflict.
With the collation in master DB I canâ't change it, so when I try to change
any thing, said that I canâ't change a system DB.
The unique way that I see to restore de DB is delete before Restore de Backup.
I must say to you this problem that I have is not in a Query that I made but
is on a Spanish compiled application. And give me this error.
These changes can be easy but I canâ't see how to solve.
--
Thanks ,
Pedro
"Steen Persson (DK)" wrote:
> Pedro wrote:
> > Hi all,
> >
> > I have this problem in my SQL 2K5 Server
> > Cannot resolve the collation conflict between
> > "SQL_Latin1_General_CP1250_CI_AS" and "Latin1_General_CI_AS" in the equal to
> > operation.
> >
> > I can't solve this problem. I already try to change the data bases
> > collation, to Modern_spanish_CI_AS, but don´t solve my problem, but doesn't
> > apear any thing about my changes.
> >
> > Some body told me to change the collation in the master database. But don´t
> > let me change because is a system data base.
> >
> > What can I do I've been with this problem, 3 weeks. I don´t know wath can i
> > do more.
> > I'll be grateful if any one can help me.
> >
> >
> Hi Pedro
> Changing the collation for at database, will not change the collation
> for the columns. To do this you'll have to use ALTER TABLE.
> Instead of changing the collation on a column, you can also specify the
> collation in your compare part of the statement that fails.
> An example could be something like
> SELECT Column1, Column2
> FROM MyTable M
> WHERE EXISTS (SELECT * FROM ThisTable T WHERE M.Column1 = T.Column1
> COLLATE Latin1_General_CI_AS)
>
> --
> Regards
> Steen Schlüter Persson
> Databaseadministrator / Systemadministrator
>|||This is a multi-part message in MIME format.
--010006020804070108090304
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Pedro wrote:
> Hi,
> Tanks for your rapid answers.
> The tables of data bases where I change the collation are already in
> Modern_Spanish_CI_AS collation, but what I saw is that collation donâ't have
> nothing to do with the conflict.
> With the collation in master DB I canâ't change it, so when I try to change
> any thing, said that I canâ't change a system DB.
> The unique way that I see to restore de DB is delete before Restore de Backup.
> I must say to you this problem that I have is not in a Query that I made but
> is on a Spanish compiled application. And give me this error.
> These changes can be easy but I canâ't see how to solve.
>
Hi Pedro
If the problem is within the Master database, you'll have to rebuild the
master table. Try to look up " Changing Collations" in Books On Line.
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator
--010006020804070108090304
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Pedro wrote:
<blockquote cite="mid5529CA45-A3E8-477C-8CA1-AB85F726E0B8@.microsoft.com"
type="cite">
<pre wrap="">Hi,
Tanks for your rapid answers.
The tables of data bases where I change the collation are already in
Modern_Spanish_CI_AS collation, but what I saw is that collation donâ't have
nothing to do with the conflict.
With the collation in master DB I canâ't change it, so when I try to change
any thing, said that I canâ't change a system DB.
The unique way that I see to restore de DB is delete before Restore de Backup.
I must say to you this problem that I have is not in a Query that I made but
is on a Spanish compiled application. And give me this error.
These changes can be easy but I canâ't see how to solve.
</pre>
</blockquote>
<font size="-1"><font face="Arial">Hi Pedro<br>
<br>
If the problem is within the Master database, you'll have to rebuild
the master table. Try to look up " Changing Collations" in Books On
Line.<br>
<br>
<br>
-- <br>
Regards<br>
Steen Schlüter Persson<br>
Databaseadministrator / Systemadministrator<br>
</font></font>
</body>
</html>
--010006020804070108090304--|||Hi Steen Persson,
I'm steel with the problem. I only answare now because i must reeinstall the
SQL SERVER 2005 to change the master collation to Modern_Spanish_CI_AS. But I
steel with the same error. I already change all tables in the database to
that collation but I steel with Latin_Collation conflict.
I try to find where is going catch Latin_Collation, but without sucess.
All colations in SQL SERVER 2K5 are in Modern_Spanish_CI_AS.
What can I do?
--
Thanks ,
Pedro
"Steen Persson (DK)" wrote:
> Pedro wrote:
> > Hi,
> >
> > Tanks for your rapid answers.
> > The tables of data bases where I change the collation are already in
> > Modern_Spanish_CI_AS collation, but what I saw is that collation donâ't have
> > nothing to do with the conflict.
> > With the collation in master DB I canâ't change it, so when I try to change
> > any thing, said that I canâ't change a system DB.
> > The unique way that I see to restore de DB is delete before Restore de Backup.
> >
> > I must say to you this problem that I have is not in a Query that I made but
> > is on a Spanish compiled application. And give me this error.
> > These changes can be easy but I canâ't see how to solve.
> >
> >
> Hi Pedro
> If the problem is within the Master database, you'll have to rebuild the
> master table. Try to look up " Changing Collations" in Books On Line.
>
> --
> Regards
> Steen Schlüter Persson
> Databaseadministrator / Systemadministrator
>|||This is a multi-part message in MIME format.
--070200030707060007070508
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Pedro wrote:
> Hi Steen Persson,
> I'm steel with the problem. I only answare now because i must reeinstall the
> SQL SERVER 2005 to change the master collation to Modern_Spanish_CI_AS. But I
> steel with the same error. I already change all tables in the database to
> that collation but I steel with Latin_Collation conflict.
> I try to find where is going catch Latin_Collation, but without sucess.
> All colations in SQL SERVER 2K5 are in Modern_Spanish_CI_AS.
> What can I do?
>
Hi Pedro
I think you'll have to supply us with some samples of the code that's
generating the problem. If you are sure that everything in on the server
is using the same collation, then it's strange that it gives you the error.
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator
--070200030707060007070508
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Pedro wrote:
<blockquote cite="mid2908459C-DA9E-4EB8-813E-4D69CD4CC10D@.microsoft.com"
type="cite">
<pre wrap="">Hi Steen Persson,
I'm steel with the problem. I only answare now because i must reeinstall the
SQL SERVER 2005 to change the master collation to Modern_Spanish_CI_AS. But I
steel with the same error. I already change all tables in the database to
that collation but I steel with Latin_Collation conflict.
I try to find where is going catch Latin_Collation, but without sucess.
All colations in SQL SERVER 2K5 are in Modern_Spanish_CI_AS.
What can I do?
</pre>
</blockquote>
<font size="-1"><font face="Arial">Hi Pedro<br>
<br>
I think you'll have to supply us with some samples of the code that's
generating the problem. If you are sure that everything in on the
server is using the same collation, then it's strange that it gives you
the error.<br>
<br>
<br>
-- <br>
Regards<br>
Steen Schlüter Persson<br>
Databaseadministrator / Systemadministrator<br>
</font></font>
</body>
</html>
--070200030707060007070508--|||Hi Steen Persson,
I don´t have access to the application code, I only have access to the SQL
SRV 2K5 and it gives me this message.
************** Texto da excepção **************
System.Data.SqlClient.SqlException: Cannot resolve the collation conflict
between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the
equal to operation.
*****************************************************
BUT When i type this comand :
use Ven0
EXEC sp_help 'bparam'
It apears this collation in this Column:
Column_name Collation
TIPO_FAC Latin1_General_CI_AS
How can I change the collation in all columns?
--
Thanks ,
Pedro
"Steen Persson (DK)" wrote:
> Pedro wrote:
> > Hi Steen Persson,
> >
> > I'm steel with the problem. I only answare now because i must reeinstall the
> > SQL SERVER 2005 to change the master collation to Modern_Spanish_CI_AS. But I
> > steel with the same error. I already change all tables in the database to
> > that collation but I steel with Latin_Collation conflict.
> > I try to find where is going catch Latin_Collation, but without sucess.
> > All colations in SQL SERVER 2K5 are in Modern_Spanish_CI_AS.
> > What can I do?
> >
> >
> Hi Pedro
> I think you'll have to supply us with some samples of the code that's
> generating the problem. If you are sure that everything in on the server
> is using the same collation, then it's strange that it gives you the error.
>
> --
> Regards
> Steen Schlüter Persson
> Databaseadministrator / Systemadministrator
>|||This is a multi-part message in MIME format.
--050307040906050202030907
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Pedro wrote:
> Hi Steen Persson,
> I don´t have access to the application code, I only have access to the SQL
> SRV 2K5 and it gives me this message.
>
> ************** Texto da excepção **************
> System.Data.SqlClient.SqlException: Cannot resolve the collation conflict
> between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the
> equal to operation.
> *****************************************************
> BUT When i type this comand :
> use Ven0
> EXEC sp_help 'bparam'
> It apears this collation in this Column:
> Column_name Collation
> TIPO_FAC Latin1_General_CI_AS
> How can I change the collation in all columns?
>
Hi Pedro
You will have to use the ALTER TABLE command to change the collation for
individual columns.
The command will be something like this (taken from BOL)
ALTER TABLE MyTable ALTER COLUMN CharCol varchar(10)COLLATE
Latin1_General_CI_AS NOT NULL
You'll just have to keep in mind that there are certain restrictions on
which columns you can or can't change (e.g. computed column, CHECK
constraint and FOREIGN key). You can look up the details in Books On
Line under "Setting and changing the column collation)
(ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/d7a9638b-717c-4680-9b98-8849081e08be.htm
).
You should also make sure that your model database and tempdb are using
the desired collation. If the comparison that are causing the problem is
happaening against a temp table, then this table is created in tempdb
and it's then tempdb's collation that's being used. You can check/change
the collation for tempdb, but then you should also do it for the model
db, since it's the setting for model that are used to recreate temdb
when you restart the server.
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator
--050307040906050202030907
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Pedro wrote:
<blockquote cite="mid9822FAFC-F57F-4701-817F-4F8A18D85924@.microsoft.com"
type="cite">
<pre wrap=""> Hi Steen Persson,
I don´t have access to the application code, I only have access to the SQL
SRV 2K5 and it gives me this message.
************** Texto da excepção **************
System.Data.SqlClient.SqlException: Cannot resolve the collation conflict
between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the
equal to operation.
*****************************************************
BUT When i type this comand :
use Ven0
EXEC sp_help 'bparam'
It apears this collation in this Column:
Column_name Collation
TIPO_FAC Latin1_General_CI_AS
How can I change the collation in all columns?
</pre>
</blockquote>
<font size="-1"><font face="Arial">Hi Pedro<br>
<br>
You will have to use the ALTER TABLE command to change the collation
for individual columns. <br>
The command will be something like this (taken from BOL)<br>
<br>
</font></font>ALTER TABLE MyTable ALTER COLUMN CharCol
varchar(10)COLLATE Latin1_General_CI_AS NOT NULL
<br>
<br>
You'll just have to keep in mind that there are certain restrictions on
which columns you can or can't change (e.g. computed column, CHECK
constraint and FOREIGN key). You can look up the details in Books On
Line under "Setting and changing the column collation) (<font size="-1"><font
face="Arial"><a class="moz-txt-link-freetext" href="http://links.10026.com/?link=ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/d7a9638b-717c-4680-9b98-8849081e08be.htm">ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/d7a9638b-717c-4680-9b98-8849081e08be.htm</a>
).<br>
<br>
You should also make sure that your model database and tempdb are using
the desired collation. If the comparison that are causing the problem
is happaening against a temp table, then this table is created in
tempdb and it's then tempdb's collation that's being used. You can
check/change the collation for tempdb, but then you should also do it
for the model db, since it's the setting for model that are used to
recreate temdb when you restart the server.<br>
<br>
<br>
-- <br>
Regards<br>
Steen Schlüter Persson<br>
Databaseadministrator / Systemadministrator<br>
</font></font>
</body>
</html>
--050307040906050202030907--

Cannot resolve collation conflict for UNION operation

Hi
I am getting the above error with my SP. Why would I get this error?
Many Thanks
Jaco
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[qfm_RptgetAsbLevelGeog]') and OBJECTPROPERTY(id,
N'IsProcedure') = 1)
drop procedure [dbo].[qfm_RptgetAsbLevelGeog]
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE [dbo].[qfm_RptgetAsbLevelGeog]
@.EventID varchar(10),
@.Config int
AS
SET NOCOUNT ON
--If we want to add the main event as a row in the sql below (to make it
have a 'from event' equivalent to QFM3),
--then only need to add the @.eventid to the select.
Declare @.parID int
Declare @.GeogID varchar(5)
declare @.sql nvarchar(4000)
set @.sql=' '
if @.Config = 0 or @.Config = 1 or @.Config = 3 or @.Config = 5 or @.Config = 7
or @.Config = 9 or @.Config = 11 or @.Config = 13 or @.Config = 15
--1. find all other details of asb found to the exact same geog (so if found
at site/locn/unit, then exactly this level), including current event.
begin
set @.sql="
select e.eventid, g.site, g.location, g.unit, g.partition, 'Asbestos Found'
as asbestoststaus, es.surveydate, esd.samplenumber,
esd.materialdescription, esda.description + '[' +
ltrim(str(EventSurveyDetailAnalysisid)) + ']' as analysis,
ac.description as classification, esd.risk as hazard, esd.remarks,
g.geographyid, g.parentid, g.siteid, g.level, g.region,
ltrim(str(esd.materialareaamount)) + ' ' + c.name as extent
,dbo.fn_ParamEntry('WS Notification Detail_1016') as asbdetail
,dbo.ConcatAsbestosPath(e.eventid) as AsbestosImagePath, --new
(select site + ' ' + location + ' ' + unit + ' ' + partition from geography
where geography.geographyid = es.geographyid) as surveygeog --gja 5.12.04
from geography g, event e, eventsurvey es, eventsurveydetail esd,
asbestosclassification ac, EventSurveyDetailAnalysis esda, commonlookup c
where g.geographyid = e.geographyid --gja5.12.04
-- where g.geographyid = es.geographyid --gja5.12.04
and e.eventid = es.currenteventid
and es.eventsurveyid = esd.eventsurveyid
and ac.asbestosclassificationid = esd.classificationid
and esd.analysisid = esda.EventSurveyDetailAnalysisid
and e.geographyid in
(select geographyid from event where eventid = " + rtrim(@.EventID) + ")
-- select geographyid from event where eventid = 38590)
and c.uniqueid =* esd.materialareaunitid "
end
if @.Config = 2 or @.Config = 3 or @.Config = 6 or @.Config = 7 or @.Config = 10
or @.Config = 11 or @.Config = 14 or @.Config = 15
--2. if asb was found at at ie bridge court/2s/test, then include all for
bridge court/2s/anything, but not bridge court/2s/nothing
--ie if found at a room on a floor, report on other rooms on same floor
(with the same parent and level)
--Get all geogs for the same level (ie rooms on the same floor) as the geog
of a specific event.
begin
select @.parID = parentid from geography g, event e where g.geographyid =
e.geographyid and e.eventid = rtrim(@.EventID)
if @.parID is not null
begin
--If we are not at the highest level (site) then we can check for a parent
set @.sql = @.sql + " union
select e.eventid, g.site, g.location, g.unit, g.partition, 'Asbestos Found'
as asbestoststaus, es.surveydate, esd.samplenumber,
esd.materialdescription, esda.description + '[' +
ltrim(str(EventSurveyDetailAnalysisid)) + ']' as analysis,
ac.description as classification, esd.risk as hazard, esd.remarks,
g.geographyid, g.parentid, g.siteid, g.level, g.region,
ltrim(str(esd.materialareaamount)) + ' ' + c.name as extent
,dbo.fn_ParamEntry('WS Notification Detail_1016') as asbdetail
,dbo.ConcatAsbestosPath(e.eventid) as AsbestosImagePath, --new
(select site + ' ' + location + ' ' + unit + ' ' + partition from
geography where geography.geographyid = es.geographyid) as surveygeog --gja
5.12.04
from geography g, event e, eventsurvey es, eventsurveydetail esd,
asbestosclassification ac, EventSurveyDetailAnalysis esda, commonlookup c
where g.geographyid = e.geographyid --gja5.12.04
-- where g.geographyid = es.geographyid --gja5.12.04
and e.geographyid in
(select g2.geographyid
from geography g2, geography g
where g.geographyid in (select geographyid from event where eventid = " +
rtrim(@.EventID) + ")
and g.parentid = g2.parentid
and g.level = g2.level) and e.eventid = es.currenteventid
and es.eventsurveyid = esd.eventsurveyid
and ac.asbestosclassificationid = esd.classificationid
and esd.analysisid = esda.EventSurveyDetailAnalysisid
and c.uniqueid =* esd.materialareaunitid "
-- print 'first'
-- print 'Config=2'
end
else
begin
set @.sql = @.sql + " union
select e.eventid, g.site, g.location, g.unit, g.partition, 'Asbestos Found'
as asbestoststaus, es.surveydate, esd.samplenumber,
esd.materialdescription, esda.description + '[' +
ltrim(str(EventSurveyDetailAnalysisid)) + ']' as analysis,
ac.description as classification, esd.risk as hazard, esd.remarks,
g.geographyid, g.parentid, g.siteid, g.level, g.region,
ltrim(str(esd.materialareaamount)) + ' ' + c.name as extent
,dbo.fn_ParamEntry('WS Notification Detail_1016') as asbdetail
,dbo.ConcatAsbestosPath(e.eventid) as AsbestosImagePath, --new
(select site + ' ' + location + ' ' + unit + ' ' + partition from
geography where geography.geographyid = es.geographyid) as surveygeog --gja
5.12.04
from geography g, event e, eventsurvey es, eventsurveydetail esd,
asbestosclassification ac, EventSurveyDetailAnalysis esda, commonlookup c
where g.geographyid = e.geographyid --gja5.12.04
-- where g.geographyid = es.geographyid --gja5.12.04
and e.eventid = es.currenteventid
and es.eventsurveyid = esd.eventsurveyid
and ac.asbestosclassificationid = esd.classificationid
and esd.analysisid = esda.EventSurveyDetailAnalysisid
and g.parentid is null
and g.geographyid = (select geographyid from event where eventid = " +
rtrim(@.EventID) + ")
and c.uniqueid =* esd.materialareaunitid "
end
end
if @.Config = 4 or @.Config = 5 or @.Config = 6 or @.Config = 7 or @.Config = 12
or @.Config = 13 or @.Config = 14 or @.Config = 15
--3. if asb was found at at ie red lion court/3rd/, then include all for red
lion court/3rd/anything below.
--Do we not then include the current event? (as it is obviously not below
the level of geog for the current event)?
--JF says maybe, maybe not, so does.
--Use the eventid to get the geography level
begin
select @.GeogID = GeographyID from event where eventid = rtrim(@.EventID)
set @.sql = @.sql + " union
select eventid ,
site ,
location ,
unit ,
partition ,
asbestoststaus ,
surveydate datetime,
samplenumber ,
materialdescription ,
analysis ,
classification ,
hazard ,
remarks ,
geographyid ,
parentid ,
siteid ,
level ,
region ,
extent
,dbo.fn_ParamEntry('WS Notification Detail_1016') as asbdetail,
AsbestosImagePath,
surveygeog --gja5.12.04
from AsbLowestLevel "+ "(" +rtrim( @.EventID) + "," + @.GeogID +") "
--print 'Config=3'
end
if @.Config = 8 or @.Config = 9 or @.Config = 10 or @.Config = 11 or @.Config =
12 or @.Config = 13 or @.Config = 14 or @.Config = 15
--4. as 3 only cant have anything below 2s (if unit or part then dont
include)
--ie if asb was found at at ie bridge court/2s/test, then include all geogs
at bridge court/2s/nothing.
--Do we not then include the current event? (as it is obviously not below
the level of geog for the current event)?
--JF says maybe, maybe not, so does.
begin
select @.GeogID = GeographyID from event where eventid = rtrim(@.EventID)
set @.sql = @.sql + " union
select eventid ,
site ,
location ,
unit ,
partition ,
asbestoststaus ,
surveydate datetime,
samplenumber ,
materialdescription ,
analysis ,
classification ,
hazard ,
remarks ,
geographyid ,
parentid ,
siteid ,
level ,
region ,
extent
,dbo.fn_ParamEntry('WS Notification Detail_1016') as asbdetail,
AsbestosImagePath,
surveygeog --gja5.12.04
from AsbHighestLevel "+ "(" +rtrim( @.EventID) + "," + @.GeogID +") "
end
if left(@.sql, 7) = ' union'
set @.sql = substring(@.sql, 8, len(@.sql) - 7)
set @.sql = @.sql + " order by 1"
exec sp_executesql @.sql
--end
SET NOCOUNT OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GOJaco,
The UNION operator will scan the inputs to remove duplicates (comparing all
members of the select list). There should be columns, in the tables involved
,
with different collation. You can use COLLATE apply a collation cast to the
character expression. See this example:
Example:
use northwind
go
create table t1 (
colA varchar(25) collate SQL_Latin1_General_CP1_CI_AS
)
go
create table t2 (
colA varchar(25) collate SQL_Latin1_General_CP1_CS_AS
)
go
insert into t1 values('microsoft')
insert into t1 values('Microsoft')
go
-- this will fail with the error mentioned
select colA from t1
union
select colA from t2
go
select colA from t1
union
select colA collate SQL_Latin1_General_CP1_CI_AS from t2
go
drop table t1, t2
go
AMB
"Jaco" wrote:

> Hi
> I am getting the above error with my SP. Why would I get this error?
> Many Thanks
> Jaco
>
> if exists (select * from dbo.sysobjects where id =
> object_id(N'[dbo].[qfm_RptgetAsbLevelGeog]') and OBJECTPROPERTY(id,
> N'IsProcedure') = 1)
> drop procedure [dbo].[qfm_RptgetAsbLevelGeog]
> GO
> SET QUOTED_IDENTIFIER OFF
> GO
> SET ANSI_NULLS OFF
> GO
>
> CREATE PROCEDURE [dbo].[qfm_RptgetAsbLevelGeog]
> @.EventID varchar(10),
> @.Config int
> AS
>
> SET NOCOUNT ON
> --If we want to add the main event as a row in the sql below (to make it
> have a 'from event' equivalent to QFM3),
> --then only need to add the @.eventid to the select.
> Declare @.parID int
> Declare @.GeogID varchar(5)
> declare @.sql nvarchar(4000)
> set @.sql=' '
> if @.Config = 0 or @.Config = 1 or @.Config = 3 or @.Config = 5 or @.Config = 7
> or @.Config = 9 or @.Config = 11 or @.Config = 13 or @.Config = 15
> --1. find all other details of asb found to the exact same geog (so if fou
nd
> at site/locn/unit, then exactly this level), including current event.
> begin
> set @.sql="
> select e.eventid, g.site, g.location, g.unit, g.partition, 'Asbestos Found
'
> as asbestoststaus, es.surveydate, esd.samplenumber,
> esd.materialdescription, esda.description + '[' +
> ltrim(str(EventSurveyDetailAnalysisid)) + ']' as analysis,
> ac.description as classification, esd.risk as hazard, esd.remarks,
> g.geographyid, g.parentid, g.siteid, g.level, g.region,
> ltrim(str(esd.materialareaamount)) + ' ' + c.name as extent
> ,dbo.fn_ParamEntry('WS Notification Detail_1016') as asbdetail
> ,dbo.ConcatAsbestosPath(e.eventid) as AsbestosImagePath, --new
> (select site + ' ' + location + ' ' + unit + ' ' + partition from geograp
hy
> where geography.geographyid = es.geographyid) as surveygeog --gja 5.12.04
> from geography g, event e, eventsurvey es, eventsurveydetail esd,
> asbestosclassification ac, EventSurveyDetailAnalysis esda, commonlookup c
> where g.geographyid = e.geographyid --gja5.12.04
> -- where g.geographyid = es.geographyid --gja5.12.04
> and e.eventid = es.currenteventid
> and es.eventsurveyid = esd.eventsurveyid
> and ac.asbestosclassificationid = esd.classificationid
> and esd.analysisid = esda.EventSurveyDetailAnalysisid
> and e.geographyid in
> (select geographyid from event where eventid = " + rtrim(@.EventID) + ")
> -- select geographyid from event where eventid = 38590)
> and c.uniqueid =* esd.materialareaunitid "
>
> end
>
> if @.Config = 2 or @.Config = 3 or @.Config = 6 or @.Config = 7 or @.Config =
10
> or @.Config = 11 or @.Config = 14 or @.Config = 15
> --2. if asb was found at at ie bridge court/2s/test, then include all for
> bridge court/2s/anything, but not bridge court/2s/nothing
> --ie if found at a room on a floor, report on other rooms on same floor
> (with the same parent and level)
> --Get all geogs for the same level (ie rooms on the same floor) as the geo
g
> of a specific event.
> begin
> select @.parID = parentid from geography g, event e where g.geographyid =
> e.geographyid and e.eventid = rtrim(@.EventID)
> if @.parID is not null
> begin
> --If we are not at the highest level (site) then we can check for a paren
t
> set @.sql = @.sql + " union
> select e.eventid, g.site, g.location, g.unit, g.partition, 'Asbestos Foun
d'
> as asbestoststaus, es.surveydate, esd.samplenumber,
> esd.materialdescription, esda.description + '[' +
> ltrim(str(EventSurveyDetailAnalysisid)) + ']' as analysis,
> ac.description as classification, esd.risk as hazard, esd.remarks,
> g.geographyid, g.parentid, g.siteid, g.level, g.region,
> ltrim(str(esd.materialareaamount)) + ' ' + c.name as extent
> ,dbo.fn_ParamEntry('WS Notification Detail_1016') as asbdetail
> ,dbo.ConcatAsbestosPath(e.eventid) as AsbestosImagePath, --new
> (select site + ' ' + location + ' ' + unit + ' ' + partition from
> geography where geography.geographyid = es.geographyid) as surveygeog --gj
a
> 5.12.04
> from geography g, event e, eventsurvey es, eventsurveydetail esd,
> asbestosclassification ac, EventSurveyDetailAnalysis esda, commonlookup c
> where g.geographyid = e.geographyid --gja5.12.04
> -- where g.geographyid = es.geographyid --gja5.12.04
> and e.geographyid in
> (select g2.geographyid
> from geography g2, geography g
> where g.geographyid in (select geographyid from event where eventid = "
+
> rtrim(@.EventID) + ")
> and g.parentid = g2.parentid
> and g.level = g2.level) and e.eventid = es.currenteventid
> and es.eventsurveyid = esd.eventsurveyid
> and ac.asbestosclassificationid = esd.classificationid
> and esd.analysisid = esda.EventSurveyDetailAnalysisid
> and c.uniqueid =* esd.materialareaunitid "
>
> -- print 'first'
> -- print 'Config=2'
> end
> else
> begin
> set @.sql = @.sql + " union
> select e.eventid, g.site, g.location, g.unit, g.partition, 'Asbestos Foun
d'
> as asbestoststaus, es.surveydate, esd.samplenumber,
> esd.materialdescription, esda.description + '[' +
> ltrim(str(EventSurveyDetailAnalysisid)) + ']' as analysis,
> ac.description as classification, esd.risk as hazard, esd.remarks,
> g.geographyid, g.parentid, g.siteid, g.level, g.region,
> ltrim(str(esd.materialareaamount)) + ' ' + c.name as extent
> ,dbo.fn_ParamEntry('WS Notification Detail_1016') as asbdetail
> ,dbo.ConcatAsbestosPath(e.eventid) as AsbestosImagePath, --new
> (select site + ' ' + location + ' ' + unit + ' ' + partition from
> geography where geography.geographyid = es.geographyid) as surveygeog --gj
a
> 5.12.04
> from geography g, event e, eventsurvey es, eventsurveydetail esd,
> asbestosclassification ac, EventSurveyDetailAnalysis esda, commonlookup c
> where g.geographyid = e.geographyid --gja5.12.04
> -- where g.geographyid = es.geographyid --gja5.12.04
> and e.eventid = es.currenteventid
> and es.eventsurveyid = esd.eventsurveyid
> and ac.asbestosclassificationid = esd.classificationid
> and esd.analysisid = esda.EventSurveyDetailAnalysisid
> and g.parentid is null
> and g.geographyid = (select geographyid from event where eventid = " +
> rtrim(@.EventID) + ")
> and c.uniqueid =* esd.materialareaunitid "
>
> end
> end
>
> if @.Config = 4 or @.Config = 5 or @.Config = 6 or @.Config = 7 or @.Config =
12
> or @.Config = 13 or @.Config = 14 or @.Config = 15
> --3. if asb was found at at ie red lion court/3rd/, then include all for r
ed
> lion court/3rd/anything below.
> --Do we not then include the current event? (as it is obviously not below
> the level of geog for the current event)?
> --JF says maybe, maybe not, so does.
> --Use the eventid to get the geography level
> begin
> select @.GeogID = GeographyID from event where eventid = rtrim(@.EventID)
> set @.sql = @.sql + " union
> select eventid ,
> site ,
> location ,
> unit ,
> partition ,
> asbestoststaus ,
> surveydate datetime,
> samplenumber ,
> materialdescription ,
> analysis ,
> classification ,
> hazard ,
> remarks ,
> geographyid ,
> parentid ,
> siteid ,
> level ,
> region ,
> extent
> ,dbo.fn_ParamEntry('WS Notification Detail_1016') as asbdetail,
> AsbestosImagePath,
> surveygeog --gja5.12.04
> from AsbLowestLevel "+ "(" +rtrim( @.EventID) + "," + @.GeogID +") "
>
> --print 'Config=3'
> end
>
> if @.Config = 8 or @.Config = 9 or @.Config = 10 or @.Config = 11 or @.Config
=
> 12 or @.Config = 13 or @.Config = 14 or @.Config = 15
> --4. as 3 only cant have anything below 2s (if unit or part then dont
> include)
> --ie if asb was found at at ie bridge court/2s/test, then include all geo
gs
> at bridge court/2s/nothing.
> --Do we not then include the current event? (as it is obviously not below
> the level of geog for the current event)?
> --JF says maybe, maybe not, so does.
> begin
> select @.GeogID = GeographyID from event where eventid = rtrim(@.EventID)
> set @.sql = @.sql + " union
> select eventid ,
> site ,
> location ,
> unit ,
> partition ,
> asbestoststaus ,
> surveydate datetime,
> samplenumber ,
> materialdescription ,
> analysis ,
> classification ,
> hazard ,
> remarks ,
> geographyid ,
> parentid ,
> siteid ,
> level ,
> region ,
> extent
> ,dbo.fn_ParamEntry('WS Notification Detail_1016') as asbdetail,
> AsbestosImagePath,
> surveygeog --gja5.12.04
>
> from AsbHighestLevel "+ "(" +rtrim( @.EventID) + "," + @.GeogID +") "
>
> end
>
> if left(@.sql, 7) = ' union'
> set @.sql = substring(@.sql, 8, len(@.sql) - 7)
> set @.sql = @.sql + " order by 1"
>
> exec sp_executesql @.sql
>
>
> --end
> SET NOCOUNT OFF
> GO
> SET QUOTED_IDENTIFIER OFF
> GO
> SET ANSI_NULLS ON
> GO
>|||Hi
Without DDL for the tables it is hard to say where the conflict occurs, but
the way to debug it would be to use profile to get the final SQL statement
and then you can find out which part of the union is causing the conflict an
d
use the COLLATE option to force the collation.
John
"Jaco" wrote:

> Hi
> I am getting the above error with my SP. Why would I get this error?
> Many Thanks
> Jaco
>
> if exists (select * from dbo.sysobjects where id =
> object_id(N'[dbo].[qfm_RptgetAsbLevelGeog]') and OBJECTPROPERTY(id,
> N'IsProcedure') = 1)
> drop procedure [dbo].[qfm_RptgetAsbLevelGeog]
> GO
> SET QUOTED_IDENTIFIER OFF
> GO
> SET ANSI_NULLS OFF
> GO
>
> CREATE PROCEDURE [dbo].[qfm_RptgetAsbLevelGeog]
> @.EventID varchar(10),
> @.Config int
> AS
>
> SET NOCOUNT ON
> --If we want to add the main event as a row in the sql below (to make it
> have a 'from event' equivalent to QFM3),
> --then only need to add the @.eventid to the select.
> Declare @.parID int
> Declare @.GeogID varchar(5)
> declare @.sql nvarchar(4000)
> set @.sql=' '
> if @.Config = 0 or @.Config = 1 or @.Config = 3 or @.Config = 5 or @.Config = 7
> or @.Config = 9 or @.Config = 11 or @.Config = 13 or @.Config = 15
> --1. find all other details of asb found to the exact same geog (so if fou
nd
> at site/locn/unit, then exactly this level), including current event.
> begin
> set @.sql="
> select e.eventid, g.site, g.location, g.unit, g.partition, 'Asbestos Found
'
> as asbestoststaus, es.surveydate, esd.samplenumber,
> esd.materialdescription, esda.description + '[' +
> ltrim(str(EventSurveyDetailAnalysisid)) + ']' as analysis,
> ac.description as classification, esd.risk as hazard, esd.remarks,
> g.geographyid, g.parentid, g.siteid, g.level, g.region,
> ltrim(str(esd.materialareaamount)) + ' ' + c.name as extent
> ,dbo.fn_ParamEntry('WS Notification Detail_1016') as asbdetail
> ,dbo.ConcatAsbestosPath(e.eventid) as AsbestosImagePath, --new
> (select site + ' ' + location + ' ' + unit + ' ' + partition from geograp
hy
> where geography.geographyid = es.geographyid) as surveygeog --gja 5.12.04
> from geography g, event e, eventsurvey es, eventsurveydetail esd,
> asbestosclassification ac, EventSurveyDetailAnalysis esda, commonlookup c
> where g.geographyid = e.geographyid --gja5.12.04
> -- where g.geographyid = es.geographyid --gja5.12.04
> and e.eventid = es.currenteventid
> and es.eventsurveyid = esd.eventsurveyid
> and ac.asbestosclassificationid = esd.classificationid
> and esd.analysisid = esda.EventSurveyDetailAnalysisid
> and e.geographyid in
> (select geographyid from event where eventid = " + rtrim(@.EventID) + ")
> -- select geographyid from event where eventid = 38590)
> and c.uniqueid =* esd.materialareaunitid "
>
> end
>
> if @.Config = 2 or @.Config = 3 or @.Config = 6 or @.Config = 7 or @.Config =
10
> or @.Config = 11 or @.Config = 14 or @.Config = 15
> --2. if asb was found at at ie bridge court/2s/test, then include all for
> bridge court/2s/anything, but not bridge court/2s/nothing
> --ie if found at a room on a floor, report on other rooms on same floor
> (with the same parent and level)
> --Get all geogs for the same level (ie rooms on the same floor) as the geo
g
> of a specific event.
> begin
> select @.parID = parentid from geography g, event e where g.geographyid =
> e.geographyid and e.eventid = rtrim(@.EventID)
> if @.parID is not null
> begin
> --If we are not at the highest level (site) then we can check for a paren
t
> set @.sql = @.sql + " union
> select e.eventid, g.site, g.location, g.unit, g.partition, 'Asbestos Foun
d'
> as asbestoststaus, es.surveydate, esd.samplenumber,
> esd.materialdescription, esda.description + '[' +
> ltrim(str(EventSurveyDetailAnalysisid)) + ']' as analysis,
> ac.description as classification, esd.risk as hazard, esd.remarks,
> g.geographyid, g.parentid, g.siteid, g.level, g.region,
> ltrim(str(esd.materialareaamount)) + ' ' + c.name as extent
> ,dbo.fn_ParamEntry('WS Notification Detail_1016') as asbdetail
> ,dbo.ConcatAsbestosPath(e.eventid) as AsbestosImagePath, --new
> (select site + ' ' + location + ' ' + unit + ' ' + partition from
> geography where geography.geographyid = es.geographyid) as surveygeog --gj
a
> 5.12.04
> from geography g, event e, eventsurvey es, eventsurveydetail esd,
> asbestosclassification ac, EventSurveyDetailAnalysis esda, commonlookup c
> where g.geographyid = e.geographyid --gja5.12.04
> -- where g.geographyid = es.geographyid --gja5.12.04
> and e.geographyid in
> (select g2.geographyid
> from geography g2, geography g
> where g.geographyid in (select geographyid from event where eventid = "
+
> rtrim(@.EventID) + ")
> and g.parentid = g2.parentid
> and g.level = g2.level) and e.eventid = es.currenteventid
> and es.eventsurveyid = esd.eventsurveyid
> and ac.asbestosclassificationid = esd.classificationid
> and esd.analysisid = esda.EventSurveyDetailAnalysisid
> and c.uniqueid =* esd.materialareaunitid "
>
> -- print 'first'
> -- print 'Config=2'
> end
> else
> begin
> set @.sql = @.sql + " union
> select e.eventid, g.site, g.location, g.unit, g.partition, 'Asbestos Foun
d'
> as asbestoststaus, es.surveydate, esd.samplenumber,
> esd.materialdescription, esda.description + '[' +
> ltrim(str(EventSurveyDetailAnalysisid)) + ']' as analysis,
> ac.description as classification, esd.risk as hazard, esd.remarks,
> g.geographyid, g.parentid, g.siteid, g.level, g.region,
> ltrim(str(esd.materialareaamount)) + ' ' + c.name as extent
> ,dbo.fn_ParamEntry('WS Notification Detail_1016') as asbdetail
> ,dbo.ConcatAsbestosPath(e.eventid) as AsbestosImagePath, --new
> (select site + ' ' + location + ' ' + unit + ' ' + partition from
> geography where geography.geographyid = es.geographyid) as surveygeog --gj
a
> 5.12.04
> from geography g, event e, eventsurvey es, eventsurveydetail esd,
> asbestosclassification ac, EventSurveyDetailAnalysis esda, commonlookup c
> where g.geographyid = e.geographyid --gja5.12.04
> -- where g.geographyid = es.geographyid --gja5.12.04
> and e.eventid = es.currenteventid
> and es.eventsurveyid = esd.eventsurveyid
> and ac.asbestosclassificationid = esd.classificationid
> and esd.analysisid = esda.EventSurveyDetailAnalysisid
> and g.parentid is null
> and g.geographyid = (select geographyid from event where eventid = " +
> rtrim(@.EventID) + ")
> and c.uniqueid =* esd.materialareaunitid "
>
> end
> end
>
> if @.Config = 4 or @.Config = 5 or @.Config = 6 or @.Config = 7 or @.Config =
12
> or @.Config = 13 or @.Config = 14 or @.Config = 15
> --3. if asb was found at at ie red lion court/3rd/, then include all for r
ed
> lion court/3rd/anything below.
> --Do we not then include the current event? (as it is obviously not below
> the level of geog for the current event)?
> --JF says maybe, maybe not, so does.
> --Use the eventid to get the geography level
> begin
> select @.GeogID = GeographyID from event where eventid = rtrim(@.EventID)
> set @.sql = @.sql + " union
> select eventid ,
> site ,
> location ,
> unit ,
> partition ,
> asbestoststaus ,
> surveydate datetime,
> samplenumber ,
> materialdescription ,
> analysis ,
> classification ,
> hazard ,
> remarks ,
> geographyid ,
> parentid ,
> siteid ,
> level ,
> region ,
> extent
> ,dbo.fn_ParamEntry('WS Notification Detail_1016') as asbdetail,
> AsbestosImagePath,
> surveygeog --gja5.12.04
> from AsbLowestLevel "+ "(" +rtrim( @.EventID) + "," + @.GeogID +") "
>
> --print 'Config=3'
> end
>
> if @.Config = 8 or @.Config = 9 or @.Config = 10 or @.Config = 11 or @.Config
=
> 12 or @.Config = 13 or @.Config = 14 or @.Config = 15
> --4. as 3 only cant have anything below 2s (if unit or part then dont
> include)
> --ie if asb was found at at ie bridge court/2s/test, then include all geo
gs
> at bridge court/2s/nothing.
> --Do we not then include the current event? (as it is obviously not below
> the level of geog for the current event)?
> --JF says maybe, maybe not, so does.
> begin
> select @.GeogID = GeographyID from event where eventid = rtrim(@.EventID)
> set @.sql = @.sql + " union
> select eventid ,
> site ,
> location ,
> unit ,
> partition ,
> asbestoststaus ,
> surveydate datetime,
> samplenumber ,
> materialdescription ,
> analysis ,
> classification ,
> hazard ,
> remarks ,
> geographyid ,
> parentid ,
> siteid ,
> level ,
> region ,
> extent
> ,dbo.fn_ParamEntry('WS Notification Detail_1016') as asbdetail,
> AsbestosImagePath,
> surveygeog --gja5.12.04
>
> from AsbHighestLevel "+ "(" +rtrim( @.EventID) + "," + @.GeogID +") "
>
> end
>
> if left(@.sql, 7) = ' union'
> set @.sql = substring(@.sql, 8, len(@.sql) - 7)
> set @.sql = @.sql + " order by 1"
>
> exec sp_executesql @.sql
>
>
> --end
> SET NOCOUNT OFF
> GO
> SET QUOTED_IDENTIFIER OFF
> GO
> SET ANSI_NULLS ON
> GO
>

Cannot resolve collation conflict for equal to operation.

Hy Guys!

I`m having a new problem today!
I Have two Databases, with the same collation configuration. (SQL_Latin1_General_CP1_CI_AS). But when I execute this qery, I got the collation message error:

select * from Cheque C
where
NOT EXISTS
(SELECT A.cmpCod + A.banCod
FROM dbCorporativo.dbo.Agencia A
WHERE
C.chqCmc7Compe + C.chqCmc7Bco
=
A.cmpCod + A.banCod
)

Result
Cannot resolve collation conflict for equal to operation.

This query executes with succes when I execute it like this:
select * from Cheque C
where
NOT EXISTS
(SELECT A.cmpCod + A.banCod
FROM dbCorporativo.dbo.Agencia A
WHERE
C.chqCmc7Compe + C.chqCmc7Bco
=
A.cmpCod + A.banCod COLLATE SQL_Latin1_General_CP1_CI_AS
)

Some suggestions? Since the configuration for the two databases are identical?Ooopppss!! WRONG FORUM!

Sorry guys!|||Diogo,

The model database must have different collation settings, temp databases / tables obtain/inherit the model database settings. When you specify a collation it sets the collation and thus there are no problems.

Cannot resolve collation conflict for equal to operation.

Hi,
I am getting this error while trying to join two tables on two different
databases.
How can I find out the collation on each and how can I make them similar?
Plz help.
Thnx in advanceMay be the collation of the columns participating in the join are not the
same. You can select from information_schema.columns to see the collation of
those columns and pick one collation to be used with COLLATE clause.
Example:
declare @.t1 table(c1 varchar(25) collate SQL_Latin1_General_CP1_CI_AS)
declare @.t2 table(c1 varchar(25) collate SQL_Latin1_General_CP1_CS_AS)
insert into @.t1 values('microsoft')
insert into @.t2 values('microsoft')
select
*
from
@.t1 as t1
inner join
@.t2 as t2
on t1.c1 = t2.c1 collate SQL_Latin1_General_CP1_CI_AS
if you do not use the "collate" clause in the join, you will get same error
that you mentioned.
AMB
"dotnettester" wrote:

> Hi,
> I am getting this error while trying to join two tables on two different
> databases.
> How can I find out the collation on each and how can I make them similar?
> Plz help.
> Thnx in advance

Cannot resolve collation conflict for equal to operation.

Hi, I have this error when running a query:

Cannot resolve collation conflict for equal to operation.

but the situation is that I can run the query perfectly with one user (windows user) but using an standar user, I've got the error, as far as I know the collation feature applies to db's an objects not to users, what can I do to run this query with the standar user? both users have the same permission on the db. Below is the query attached.

Thank you
Gabriel

SELECT B.EmpSupervisorId, a.Info_ID as A_Info_ID,
ISNULL(a.Owner_SSO_ID,'') as A_Owner_SSO_ID,
ISNULL(a.Ref_SSO_ID,'') as A_Ref_SSO_ID,
ISNULL(a.Prev_Owner_SSO_ID,0) as A_Prev_Owner_SSO_ID,
ISNULL(a.MgmtTypeFlag,0) as A_MgmtTypeFlag,
ISNULL(a.CurrentStatusID, 1) as A_CurrentStatusID,
ISNULL(a.PrevStatusID,0) as A_PrevStatusID,
ISNULL(C.ConTypeOption, '') as C_ConTypeOption,
ISNULL(CAST(a.Last_Status_Update_Date AS VARCHAR),'') as A_Last_Status_Update_Date,
ISNULL(B.sfBUID,'0') as A_Bus_Group_ID, 0 AS A_Bus_Group_Seg_ID,
ISNULL(a.Organization,'') as A_Organization,
ISNULL(a.ContactName,'') as A_ContactName,
ISNULL(A.Title, '') as A_ContactTitle,
ISNULL(a.ContactComName,'') as A_ContactComName, ISNULL(a.Phone,'') as A_Phone,
ISNULL(a.NatureOfOppID,'') as A_NatureOfOppID, ISNULL(a.DealAmount,0) as A_DealAmount, ISNULL(CAST(a.Cust_Contacted_Date AS VARCHAR),'') A_Cust_Contacted_Date, ISNULL(CAST(a.Lead_Qualified_Date AS VARCHAR),'') A_Lead_Qualified_Date, ISNULL(CAST(a.Tran_Processed_Date AS VARCHAR),'') A_Tran_Processed_Date,
ISNULL(CAST(a.Quote_Accepted_Date AS VARCHAR),'') as A_Quote_Accepted_Date,
ISNULL(CAST(a.Approved_By_HFS_Date AS VARCHAR),'') as A_Approved_By_HFS_Date,
ISNULL(CAST(a.Funded_By_HFS_Date AS VARCHAR),'') as A_Funded_By_HFS_Date,
ISNULL(a.Lead_In_Amount,0) as A_Lead_In_Amount,
ISNULL(a.Cust_Contacted_Amount,0) as A_Cust_Contacted_Amount,
ISNULL(a.Lead_Qualified_Amount,0) as A_Lead_Qualified_Amount,
ISNULL(a.Tran_Processed_Amount,0) as A_Tran_Processed_Amount,
ISNULL(a.Quote_Accepted_Amount,0) as A_Quote_Accepted_Amount,
ISNULL(a.Approved_By_HFS_Amount,0) as A_Approved_By_HFS_Amount,
ISNULL(a.Funded_By_HFS_Amount,0) as A_Funded_By_HFS_Amount,
ISNULL(CAST(CreationDate AS VARCHAR),'') as A_CreationDate,
ISNULL(a.BusType,'') as A_BusType,
ISNULL(a.NonHFS_XLink_ContactName,'') as A_NonHFS_XLink_ContactName,
ISNULL(a.NonHFS_XLink_Bus_ID,'0') as A_NonHFS_XLink_Bus_ID,
ISNULL(a.Comments,'') as A_Comments, ISNULL(a.ExistCustomerID,'') as A_ExistCustomerID,
ISNULL(a.FinancialNeedID,'') as A_FinancialNeedID,
ISNULL(a.CampaignID,'') as A_CampaignID,
(GEC_HFS_CORE.dbo.GetBusinessDays(Last_Status_Upda te_Date, getdate())-1) as BusDateDiff, ISNULL(A.DealTypeID, '') as A_DealTypeID
FROM tblInformation a
LEFT OUTER JOIN GEC_HFS_LM_SSOInfo B ON A.Owner_SSO_ID = B.sfSSOID
LEFT OUTER JOIN tblContactType C ON a.Bustype = C.ConType_ID
WHERE a.CurrentStatusID NOT IN (9, 10, 11) AND
ISNULL(a.isNoChange,'NO') = 'NO' AND ISNULL(a.IsDeleted,'NO') = 'NO' AND
DATEDIFF(DAY, Last_Status_Update_Date, GETDATE())<> 0 AND
ISNULL(a.isNonHFS, 'NO') = 'NO'
ORDER BY A_Info_IDAdd COLLATE DATABASE_DEFAULT to character-based comparison operations and forget it.|||It is woking now, tks. Any idea why it is necessary to specify this on one account and not with the other? I wuold like to have something to say to the users.

Tks
GAP|||Here's what I think (it may be too far fetched, but I've seen it):

One of the tables has a twin brother under a different schema, which happens to be the standard login. That twin brother somehow was built using different collation. When that user logs on and runs the query (AND since you do not qualify the tables by schema) the twin brother is picked, thus, - collation errors.

Cannot resolve collation conflict for equal to operation.

I'm trying to audit our sql server and getting a collation error. "Cannot
resolve collation conflict for equal to operation." I know 3 of the
databases on this server have a different collation, but I need to find a wa
y
to get around this since I can't change the collation because they are vendo
r
databases. Does anyone have any ideas? I'm at a loss and this is due to our
auditors within the next few days. Thanks in advance for your help! This is
the code I'm using to audit:
DECLARE @.spname VARCHAR (128)
DECLARE @.dbname VARCHAR (128)
DECLARE @.logiNAME VARCHAR (2000)
DECLARE @.cmd VARCHAR (5000)
-- Declare cursor
DECLARE sp_csr INSENSITIVE CURSOR FOR
select name as dbname from sysdatabases
order by name
-- Open the cursor
OPEN sp_csr
-- Loop through all the databases in the database
FETCH NEXT
FROM sp_csr
INTO @.dbname
print @.dbname
WHILE @.@.FETCH_STATUS = 0
BEGIN
SELECT @.cmd = 'Use ' + @.dbname + ' '+ 'SELECT ''ROLE NAME'' = b.name, 30,
''OBJECT NAME'' = c.name, 30,
''ACTION'' = CASE a.action
WHEN 26 THEN ''REFERENCES''
WHEN 193 THEN ''SELECT''
WHEN 195 THEN ''INSERT''
WHEN 196 THEN ''DELETE''
WHEN 197 THEN ''UPDATE''
WHEN 198 THEN ''CREATE TABLE''
WHEN 203 THEN ''CREATE DATABASE''
WHEN 204 THEN ''GRANT_W_GRANT''
WHEN 205 THEN ''GRANT''
WHEN 206 THEN ''REVOKE''
WHEN 207 THEN ''CREATE VIEW''
WHEN 222 THEN ''CREATE PROCEDURE''
WHEN 224 THEN ''EXECUTE''
WHEN 228 THEN ''DUMP DATABASE''
WHEN 233 THEN ''CREATE DEFAULT''
WHEN 235 THEN ''DUMP TRANSACTION''
WHEN 236 THEN ''CREATE RULE''
END,
"TYPE" = CASE c.type
WHEN ''C'' THEN ''CHECK constraint''
WHEN ''D'' THEN ''Default or DEFAULT constraint''
WHEN ''F'' THEN ''FOREIGN KEY constraint''
WHEN ''K'' THEN ''PRIMARY KEY or UNIQUE constraint''
WHEN ''L'' THEN ''Log''
WHEN ''P'' THEN ''Stored procedure''
WHEN ''R'' THEN ''Rule''
WHEN ''RF'' THEN ''Stored procedure for replication''
WHEN ''S'' THEN ''System table''
WHEN ''TR'' THEN ''Trigger''
WHEN ''U'' THEN ''User table''
WHEN ''V'' THEN '' View''
WHEN ''X'' THEN ''Extended stored procedure''
WHEN ''FN'' THEN ''User Defined Function''
END,
ServerName=(select srvname from master..sysservers where srvid = ''0''),
DatabaseName=(SELECT master..sysdatabases.name
FROM dbo.sysfiles INNER JOIN
master..sysdatabases ON dbo.sysfiles.filename =
master..sysdatabases.filename)
, Environment = Case when (select srvname from master..sysservers where
srvid = ''0'') like ''Dev%''
THEN ''DEV''
WHEN (select srvname from master..sysservers where srvid = ''0'') like
''Prod%''
THEN ''PROD''
WHEN (select srvname from master..sysservers where srvid = ''0'')LIKE
''Test%''
THEN ''TEST''
ELSE ''Unknown''END
FROM sysprotects a, sysusers b, sysobjects c
WHERE a.uid = b.uid
AND c.id = a.id
--AND b.name = @.group
ORDER BY b.name, c.name, a.action'
--PRINT @.cmd
EXEC (@.cmd)
FETCH NEXT
FROM sp_csr
INTO @.dbname
END
-- Close and deallocate the cursor
CLOSE sp_csr
DEALLOCATE sp_csrat a glance, i'm not seeing anything jump out - first step would be
capturing the @.cmd that errored, run it separately and narrow down which
exact part is the problem.
It is possible to coerce a query to use a specified collation - after
the criteria. e.g.
...from table1 join table2 on table1.column = table2.column collate
<collation>...
...from table1 where column='some value' collate <collation>
Anita wrote:

>I'm trying to audit our sql server and getting a collation error. "Cannot
>resolve collation conflict for equal to operation." I know 3 of the
>databases on this server have a different collation, but I need to find a w
ay
>to get around this since I can't change the collation because they are vend
or
>databases. Does anyone have any ideas? I'm at a loss and this is due to our
>auditors within the next few days. Thanks in advance for your help! This is
>the code I'm using to audit:
>DECLARE @.spname VARCHAR (128)
>DECLARE @.dbname VARCHAR (128)
>DECLARE @.logiNAME VARCHAR (2000)
>DECLARE @.cmd VARCHAR (5000)
>
>-- Declare cursor
>DECLARE sp_csr INSENSITIVE CURSOR FOR
>select name as dbname from sysdatabases
>order by name
>-- Open the cursor
>OPEN sp_csr
>-- Loop through all the databases in the database
>FETCH NEXT
> FROM sp_csr
> INTO @.dbname
> print @.dbname
>WHILE @.@.FETCH_STATUS = 0
>BEGIN
> SELECT @.cmd = 'Use ' + @.dbname + ' '+ 'SELECT ''ROLE NAME'' = b.name, 30,
>''OBJECT NAME'' = c.name, 30,
>''ACTION'' = CASE a.action
>WHEN 26 THEN ''REFERENCES''
>WHEN 193 THEN ''SELECT''
>WHEN 195 THEN ''INSERT''
>WHEN 196 THEN ''DELETE''
>WHEN 197 THEN ''UPDATE''
>WHEN 198 THEN ''CREATE TABLE''
>WHEN 203 THEN ''CREATE DATABASE''
>WHEN 204 THEN ''GRANT_W_GRANT''
>WHEN 205 THEN ''GRANT''
>WHEN 206 THEN ''REVOKE''
>WHEN 207 THEN ''CREATE VIEW''
>WHEN 222 THEN ''CREATE PROCEDURE''
>WHEN 224 THEN ''EXECUTE''
>WHEN 228 THEN ''DUMP DATABASE''
>WHEN 233 THEN ''CREATE DEFAULT''
>WHEN 235 THEN ''DUMP TRANSACTION''
>WHEN 236 THEN ''CREATE RULE''
>END,
>"TYPE" = CASE c.type
>WHEN ''C'' THEN ''CHECK constraint''
>WHEN ''D'' THEN ''Default or DEFAULT constraint''
>WHEN ''F'' THEN ''FOREIGN KEY constraint''
>WHEN ''K'' THEN ''PRIMARY KEY or UNIQUE constraint''
>WHEN ''L'' THEN ''Log''
>WHEN ''P'' THEN ''Stored procedure''
>WHEN ''R'' THEN ''Rule''
>WHEN ''RF'' THEN ''Stored procedure for replication''
>WHEN ''S'' THEN ''System table''
>WHEN ''TR'' THEN ''Trigger''
>WHEN ''U'' THEN ''User table''
>WHEN ''V'' THEN '' View''
>WHEN ''X'' THEN ''Extended stored procedure''
>WHEN ''FN'' THEN ''User Defined Function''
>END,
>ServerName=(select srvname from master..sysservers where srvid = ''0''),
>DatabaseName=(SELECT master..sysdatabases.name
>FROM dbo.sysfiles INNER JOIN
> master..sysdatabases ON dbo.sysfiles.filename =
>master..sysdatabases.filename)
>, Environment = Case when (select srvname from master..sysservers where
>srvid = ''0'') like ''Dev%''
> THEN ''DEV''
> WHEN (select srvname from master..sysservers where srvid = ''0'') like
>''Prod%''
> THEN ''PROD''
> WHEN (select srvname from master..sysservers where srvid = ''0'')LIKE
>''Test%''
> THEN ''TEST''
> ELSE ''Unknown''END
>FROM sysprotects a, sysusers b, sysobjects c
>WHERE a.uid = b.uid
>AND c.id = a.id
>--AND b.name = @.group
>ORDER BY b.name, c.name, a.action'
>
> --PRINT @.cmd
>EXEC (@.cmd)
> FETCH NEXT
> FROM sp_csr
> INTO @.dbname
>END
>
>-- Close and deallocate the cursor
>CLOSE sp_csr
>DEALLOCATE sp_csr
>|||Change
DatabaseName=(SELECT master..sysdatabases.name
FROM dbo.sysfiles INNER JOIN
master..sysdatabases ON dbo.sysfiles.filename =
master..sysdatabases.filename)
to
DatabaseName=(SELECT master..sysdatabases.name
FROM dbo.sysfiles INNER JOIN
master..sysdatabases ON dbo.sysfiles.filename COLLATE
Latin1_General_CI_AS =
master..sysdatabases.filename COLLATE Latin1_General_CI_AS)|||That worked as far as getting those databases that have a different
collation's info, but I'm still getting errors. Now I'm getting these errors
:
Line 41: Incorrect syntax near 'COLLATE'.
Server: Msg 156, Level 15, State 1, Line 45
Incorrect syntax near the keyword 'like'.
Thanks!
"markc600@.hotmail.com" wrote:

> Change
> DatabaseName=(SELECT master..sysdatabases.name
> FROM dbo.sysfiles INNER JOIN
> master..sysdatabases ON dbo.sysfiles.filename =
> master..sysdatabases.filename)
> to
> DatabaseName=(SELECT master..sysdatabases.name
> FROM dbo.sysfiles INNER JOIN
> master..sysdatabases ON dbo.sysfiles.filename COLLATE
> Latin1_General_CI_AS =
> master..sysdatabases.filename COLLATE Latin1_General_CI_AS)
>

Cannot resolve collation conflict for equal to operation

Hello,
i am getting the following error in SQLServer2000:-
Cannot resolve collation conflict for equal to operation

Sequence Of Operations :
1. Restored a database from a SQLSERver7.0 backupfile into SQLServer2000 database

2. Differences found when the stored proc. 'sp_server_info' was run on SQLSErver2000 and SQLServer7.0

IDENTIFIER_CASE
SQLSERver7.0 SENSITIVE
SQLServer2000 MIXED

COLLATION_SEQ
SQLSERver7.0 :- charset=iso_1 sort_order=bin_iso_1 charset_num=1 sort_order_num=50
SQLServer2000 :- charset=iso_1 sort_order=nocase_iso charset_num=1 sort_order_num=52

3. For the command "select DATABASEPROPERTYEX()" in SQLServer2000
The temporary and master database returns --> SQL_Latin1_General_CP1_CI_AS
The restored database returns --> Latin1_General_BIN

4. I am getting the error in a sp where data is being fetched from 2 temporary tables.
I suppose the backupup database 'Collation' has to match the Master & temdb 'Collation'

How do i change the 'Collation' parameter of the new database so that it matches with the tempdb database ? Will this solve the problem ?Tempdb will use the collation of the model database when the server is started (i.e. tempdb is built).

Use can coerce the collations used in queries to compare using a specific collation.
= (colname collate collationname)

You can change the collation of a database by
alter database collate collationname
this will change the default collation for new tables
For existing ones I think you will have to run alter table scripts.

These may all change the representation of the data though.

Cannot resolve collation conflict for equal to operation

We have loaded a db from a different SQL Server, and now we are trying to recreate some stored procedures. Some procs experience the error "Cannot resolve collation conflict for equal to operation ".

Can we simply create a new db on our target Sql Server, create the tables w/ the default collation sequence, and then use DTS to pull the data and populate the new db? Will this pull the data and store it in the desired collation? Seems like it should - let me know if it will/will not work, or if there's an easier way. Thanks!apparently the default collation of your sql server is not the same as the one from which you loaded the data. you can create a new database with the collation being the same as the one that of the server from which you are getting your data. and your new database will work without you changing anything!!!

Cannot resolve collation conflict for equal operation

Hi, Im having a critical problem.

I have two databases: persons and cars

In database persons I have a table
named persons_class1 as follows:
person_id char(13) not null [primary key]
name varchar(20) not null

In database cars I have a table
named cars_blue as follows:
car_id char(13) not null [primary key]
model varchar(20) not null
person_id char(13) not null

In my program the initial catalog is: cars
and Im executing the following SQL:

select cars_blue.model,persons.dbo.persons_class1.name
from cars_blue,persons.dbo.persons_class1
where cars_blue.person_id=persons.dbo.persons_class1.per son_id

and the following error occurs:
Cannot resolve collation conflict for equal operation

I also tried like instead of = and the error is:
Cannot resolve collation conflict for like operation

what can I do?

Thanks in advance
RolandA collation is the way that characters are compared/sorted. Apparently your personid columns are character based, so at least at first I'd suggest using:select cars_blue.model,persons.dbo.persons_class1.name
from cars_blue,persons.dbo.persons_class1
where cars_blue.person_id COLLATE SQL_Latin1_General = persons.dbo.persons_class1.per son_id COLLATE SQL_Latin1_General-PatP|||Collation does not pertain to the fields that are being compared but to the operator that is used in comparison.

select cars_blue.model,persons.dbo.persons_class1.name
from cars_blue,persons.dbo.persons_class1
where cars_blue.person_id = persons.dbo.persons_class1.per son_id COLLATE SQL_Latin1_General_CP1251_CI_AS|||Collation does not pertain to the fields that are being compared but to the operator that is used in comparison.So you apply the collation to the operator, and once the collation is applied that operator will then compare any two objects? At least as I see it, the comparison operator invokes an operation which is dependant on the collations of both of the objects that are being compared. Did I miss a meeting somewhere?

-PatP|||Great, I solved the problem!!, further Im allowed to change
the default collation of the database.

Thanks!
Roland|||Well, he already solved it, so there is no point to continue, but...The COLLATE tells the optimizer what code page to use while comparing 2 values, not how they need to be collated before comparison can be performed. That's why your syntax will produce an error.|||So then how can this be?SELECT Count(*)
FROM dbo.sysobjects AS a
WHERE a.name = a.name
GO

SELECT Count(*)
FROM dbo.sysobjects AS a
WHERE a.name COLLATE Latin1_General_BIN = a.name

SELECT Count(*)
FROM dbo.sysobjects AS a
WHERE a.name COLLATE Latin1_General_BIN = a.name COLLATE Latin1_General_BIN
GO

SELECT Count(*)
FROM dbo.sysobjects AS a
WHERE a.name COLLATE Latin1_General_BIN = a.name COLLATE Cyrillic_General_BIN
GO-PatP|||Oh for Codd's sake, as you see yourself, the fourth statement will produce an error because you can't perform a comparison after collating 2 values to different code pages. Doesn't it mean to you that only 1 COLLATE statement actually makes sense? In the example below you'll see that regardless of what collation is chosen for a field, COLLATE forces the comparison to be performed using a specified code page. It does not "collate" the values!

begin tran
go
create table #t1 (f1 char(1) collate Cyrillic_General_BIN not null)
create table #t2 (f1 char(1) collate latin1_general_bin not null)
insert #t1 values ('a')
insert #t2 values ('a')
go
select * from #t1, #t2 where #t1.f1 = #t2.f1 collate French_BIN
select * from #t1 inner join #t2 on #t1.f1 = #t2.f1 collate French_BIN
go
rollback tran
go|||Oh for Codd's sake, as you see yourself, the fourth statement will produce an error because you can't perform a comparison after collating 2 values to different code pages. Doesn't it mean to you that only 1 COLLATE statement actually makes sense? In the example below you'll see that regardless of what collation is chosen for a field, COLLATE forces the comparison to be performed using a specified code page. It does not "collate" the values!In your earlier post I thought you said that the collation only applied to the operator, which I assumed meant there could only be one collation for an operator. What operator are you collating within your CREATE TABLE statements?

A collation applies to data, and within SQL Server it specifically applies to character data. You can apply operators to that character data, but you can't apply a collation to the operators. The relational operators (like equal, greather than, etc) use the collation to determine how they can compare the data. This determines things like does case matter, are accents important, what order should the characters sort, etc. Note that one set of rules can be used for sorting and a quite different set can be used for comparisons in some cases within the same collation!

-PatP