Groups | Blog | Home
all groups > sql server programming > february 2005 >

sql server programming : Query, what's wrong here?


David Portas
2/15/2005 1:40:49 PM
The error is due to a collation conflict. It looks like the Digits
column in Series must have a different collation to the Digits column
in V2tickets. Either change one of the collations or specify an
explicit collation in the query.

See Books Online for more information on collations.

--
David Portas
SQL Server MVP
--
Henry
2/15/2005 10:30:02 PM
Hi

I get an error when I try to limit the "digits" I want to summerize, I have
only added the line
"and digits in (select digits from series)"
when it there the it fails and gives the errpr Msg 446, Level 16, State 9,
Line 8

The only thing I can imagine is that it's because I'm "joining" with another
table. the datatypes are identical.


declare @site int
declare @calltype char(1)

set @site = 1
set @calltype = 'E'


SELECT digits, COUNT(*) AS total, /* Line 9 */
COUNT(CASE WHEN durationofconversation > 0 THEN 1 END) AS besvaret,
COUNT(CASE WHEN durationofconversation = 0 AND releasecause = 'OC'
THEN 1 END) AS optaget,
COUNT(CASE WHEN durationofconversation = 0 AND releasecause = 'RL'
AND durationofcall < 40 THEN 1 END) AS opgivet,
COUNT(CASE WHEN durationofconversation = 0 AND durationofcall >= 40
THEN 1 END) AS ubesvaret
FROM V2tickets WHERE
siteid = @site AND calltype = @calltype AND LEN(digits) = 4

/* adding this statement gives the errpr Msg 446, Level 16, State 9, Line 8
*/
and digits in (select digits from series)

GROUP BY digits
ORDER BY digits

regards
Henry

Henry
2/15/2005 10:50:43 PM
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@acm.org> skrev i en
meddelelse news:1108503649.678190.90910@z14g2000cwz.googlegroups.com...
[quoted text, click to view]

Been there, done that, fixed the problem, a lot of stuff to keep track off
here.

Thanks for pointing me the right direction.

regards
Henry

AddThis Social Bookmark Button