Cannot resolve collation conflict for equal to operation

Cannot resolve collation conflict for equal to operation

Post by Niklas » Wed, 01 May 2002 22:20:47



Hi!

I'm using the "Insert Into .... Select" statement to insert rows into a
temporary table, but I get an error message saying: Cannot resolve collation
conflict for equal to operation
I create and populate the table inside a stored procedure in SQL Server 2000
(SP 2). The Stored Procedure worked fine in SQL Server 7.0 (SP 3).
I don't get the error if I create a "normal" table instead of a temporary
table. Does anyone know how I can solve this problem?

//Niklas

 
 
 

Cannot resolve collation conflict for equal to operation

Post by Bart Duncan [M » Thu, 02 May 2002 04:49:58


Does the SELECT portion of the query join a temp table to a user table?  If
so, the problem is that columns in your user table have a different
collation than the default SQL system collation, and therefore a different
collation than tempdb.  Collations specify string comparison rules, so a
join between two char columns with different collations is ambiguous.  You
can resolve this by making sure that your temp tables inhereit the current
database's collation instead of the tempdb collation with a "COLLATE
database_default" clause after each char/varchar/nchar/nvarchar column.  
E.g.:

  CREATE TABLE #t1 (c1 int, c2 varchar(10) COLLATE database_default)

HTH,
Bart
------------
Bart Duncan
Microsoft SQL Server Support

Please reply to the newsgroup only - thanks.

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

| Subject: Cannot resolve collation conflict for equal to operation
| Date: Tue, 30 Apr 2002 15:20:47 +0200
| Lines: 13
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

| Newsgroups: microsoft.public.sqlserver.server
| NNTP-Posting-Host: 213.15.74.230
| Path: cpmsftngxa07!tkmsftngxs01!tkmsftngp01!tkmsftngp02
| Xref: cpmsftngxa07 microsoft.public.sqlserver.server:209268
| X-Tomcat-NG: microsoft.public.sqlserver.server
|
| Hi!
|
| I'm using the "Insert Into .... Select" statement to insert rows into a
| temporary table, but I get an error message saying: Cannot resolve
collation
| conflict for equal to operation
| I create and populate the table inside a stored procedure in SQL Server
2000
| (SP 2). The Stored Procedure worked fine in SQL Server 7.0 (SP 3).
| I don't get the error if I create a "normal" table instead of a temporary
| table. Does anyone know how I can solve this problem?
|
| //Niklas
|
|
|

 
 
 

Cannot resolve collation conflict for equal to operation

Post by Niklas » Thu, 02 May 2002 23:55:46


Thank you very much!

That solved my problem...

//Niklas



Quote:> Does the SELECT portion of the query join a temp table to a user table?
If
> so, the problem is that columns in your user table have a different
> collation than the default SQL system collation, and therefore a different
> collation than tempdb.  Collations specify string comparison rules, so a
> join between two char columns with different collations is ambiguous.  You
> can resolve this by making sure that your temp tables inhereit the current
> database's collation instead of the tempdb collation with a "COLLATE
> database_default" clause after each char/varchar/nchar/nvarchar column.
> E.g.:

>   CREATE TABLE #t1 (c1 int, c2 varchar(10) COLLATE database_default)

> HTH,
> Bart
> ------------
> Bart Duncan
> Microsoft SQL Server Support

> Please reply to the newsgroup only - thanks.

> This posting is provided "AS IS" with no warranties, and confers no

rights.
 
 
 

1. Cannot resolve collation conflict for equal to operation

I get this error on the following line:


The #PayList table looks like this:

CREATE TABLE #PayList
(
PL_ID [smallint] IDENTITY (1, 1) NOT NULL ,
PL_COName varchar(50),
PL_Desc varchar(100),
PL_Remarks varchar(200),
PL_PlannedDate SmallDateTime,
PL_Amount Numeric(9,2),
PL_PocketAmount Numeric(9,2),
PL_Qty SmallInt,
PL_SNID int,
PL_IsAdvance bit,
PL_Income bit,
PL_IsMedic bit,
PL_IsHousing bit,
PL_Category varchar(50),
PL_SubCat varchar(50)
)

I looked in google groups and this error mostly applies when using
different servers, but this is on the same server.  And it's a very
straightforward select statement.

What would be wrong?

--
Kind regards,

Stijn Verrept.

2. Report Fields Moving

3. Cannot resolve collation conflict for equal to operation.

4. Primary Keys and VB5 ??

5. Newbie: Help with DbCombo/Extended Matching

6. Cannot resolve collation conflict for equal to operation

7. Problem with JDBC

8. Cannot resolve collation conflict for equal to operation.

9. Cannot resolve collation conflict for equal to operation

10. resolve collation conflict for equal to operation?????

11. Cannot resolve collation conflict for %ls operation.????