Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
Msg 468, Level 16, State 9, Procedure...
Msg 468, Level 16, State 9, Procedure "procedurename", Line 129 Cannot resolve the collation conflict between "Latin1_General_CI_AS" and...
Rate Topic
Display Mode
Topic Options
Author
Message
tt-615680
tt-615680
Posted Thursday, April 12, 2012 8:51 AM
SSC Veteran
Group: General Forum Members
Last Login: Friday, April 12, 2013 7:42 AM
Points: 225,
Visits: 809
Dear All,
I have a stored procedure and I keep getting the following error message:
Msg 468, Level 16, State 9, Procedure "procedurename", Line 129
Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.
I looked at the Collation for the Database and it is SQL_Latin1_General_CP1_CI_AS but I don't know what else I need to do to get it working please?
Thank you in advance!
Post #1282449
Eugene Elutin
Eugene Elutin
Posted Thursday, April 12, 2012 8:58 AM
SSCrazy
Group: General Forum Members
Last Login: Today @ 9:48 AM
Points: 2,534,
Visits: 4,351
Could be anything from situation where joining tables have different collation for the columns they are joined on, to using temp tables in the proc and having different default collation in tempdb
_____________________________________________
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!"
(So many miracle inventions provided by MS to us...)
How to post your question to get the best and quick help
Post #1282456
Lynn Pettis
Lynn Pettis
Posted Thursday, April 12, 2012 8:58 AM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 2:16 PM
Points: 21,602,
Visits: 27,425
tt-615680 (4/12/2012)
Dear All,
I have a stored procedure and I keep getting the following error message:
Msg 468, Level 16, State 9, Procedure "procedurename", Line 129
Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.
I looked at the Collation for the Database and it is SQL_Latin1_General_CP1_CI_AS but I don't know what else I need to do to get it working please?
Thank you in advance!
Have you looked at line 129 in the procedure to see what is happening in the procedure at that point? We can't tell from here, our crystal balls don't seem to work.
From what you have posted there is a collation difference between two values (or columns). One is using Latin1_General_CI_AS and the other SQL_Latin1_General_CP1_CI_AS.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #1282457
tt-615680
tt-615680
Posted Thursday, April 12, 2012 9:22 AM
SSC Veteran
Group: General Forum Members
Last Login: Friday, April 12, 2013 7:42 AM
Points: 225,
Visits: 809
Thank you for your reply!
This is part of the stored procedure:
........................
...................
CREATE TABLE Data
(
Total_TY decimal(10,2), --this is where is gives the error
Total_LY decimal(10,2),
variance decimal(10,2)
)
INSERT INTO #Data
SELECT
CASE WHEN ISNULL(ISNULL(Total_TY,0)/ISNULL(Total_LY,1), 0) = ISNULL(Total_TY, 0) THEN 100
WHEN ISNULL(ISNULL(Total_LY,0)/ISNULL(Total_TY,1), 0) = ISNULL(Total_LY, 0) THEN -100
ELSE ISNULL((ISNULL(Total_TY,0)/ISNULL(Total_LY,1)), 0) END AS var
FROM #TYear c
LEFT JOIN #LYear p ON c.countryCode = p.countryCode
What I'm confused about is that when I run the same stored procedure on a different Server it runs fine and the setting for the Collation are the same.
Thank you!
Post #1282488
Lynn Pettis
Lynn Pettis
Posted Thursday, April 12, 2012 9:27 AM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 2:16 PM
Points: 21,602,
Visits: 27,425
I would look at the two temporary tables #TYear and #LYear and how they are created. Most specifically the countryCode columns.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #1282491
Perry Whittle
Perry Whittle
Posted Thursday, April 12, 2012 10:23 AM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 7:36 AM
Points: 5,201,
Visits: 11,153
tt-615680 (4/12/2012)
Thank you for your reply!
This is part of the stored procedure:
........................
...................
CREATE TABLE Data
(
Total_TY decimal(10,2), --this is where is gives the error
Total_LY decimal(10,2),
variance decimal(10,2)
)
INSERT INTO #Data
SELECT
CASE WHEN ISNULL(ISNULL(Total_TY,0)/ISNULL(Total_LY,1), 0) = ISNULL(Total_TY, 0) THEN 100
WHEN ISNULL(ISNULL(Total_LY,0)/ISNULL(Total_TY,1), 0) = ISNULL(Total_LY, 0) THEN -100
ELSE ISNULL((ISNULL(Total_TY,0)/ISNULL(Total_LY,1)), 0) END AS var
FROM #TYear c
LEFT JOIN #LYear p ON c.countryCode = p.countryCode
What I'm confused about is that when I run the same stored procedure on a different Server it runs fine and the setting for the Collation are the same.
Thank you!
What is the collation of your SQL Server instance, Tempdb objects will use the server collation and that's undoubtedly where your issue is. Post the results from the following run against your SQL instance
select serverproperty('collation')
select databasepropertyex('tempdb', 'collation')
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs"
Post #1282562
tt-615680
tt-615680
Posted Friday, April 13, 2012 8:25 AM
SSC Veteran
Group: General Forum Members
Last Login: Friday, April 12, 2013 7:42 AM
Points: 225,
Visits: 809
Thank you for all your advice!
I used COLLATE DATABASE_DEFAULT and it worked:
Table1.Column1 COLLATE DATABASE_DEFAULT = Table2.Column1 COLLATE DATABASE_DEFAULT
Thank you everyone for you advice!
Post #1283178
dineshvishe
dineshvishe
Posted Wednesday, December 05, 2012 12:13 AM
SSC Rookie
Group: General Forum Members
Last Login: Today @ 12:25 PM
Points: 40,
Visits: 218
Dear SSC Veteran,
Thanks A Lot.
Dinesh
Post #1392809
daparici
daparici
Posted Monday, April 29, 2013 9:07 AM
Forum Newbie
Group: General Forum Members
Last Login: Monday, April 29, 2013 10:57 AM
Points: 1,
Visits: 1
Thank you SSC Veteran!
Post #1447585
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.