very simple query but wrong. WHY ?

From: PGA (paolo.gabbi_at_edpsistem.it)
Date: 06/09/04


Date: 9 Jun 2004 07:07:43 -0700

Hi.
I wrote a query that doesn't work at all. Lets me write it.

-------------------------------
 declare @mm as int -- variable @mm WRITE DOWN IN LOWERCASE
 set @MM = 1 -- same variable @mm WRITE DOWN IN UPPERCASE
 print @mm
-------------------------------

running query I got the message
  Server: Msg 137, Level 15, State 1, Line 3
  Must declare the variable '@MM'

Obviously If I write down variable always uppercase or lowercase it work well.

I run SQL2000 SP.2 (8.00.534) standard edition,
Language: English (United States)
Server collation: Latin1_general_Bin
on platform Windows 2003 Italiano (Win NT 5.2 (3790))

I got the error as well I run the query on db created with default
Collation as on db created with Collation Latin1_General_CI_AI
(case insensitive, accent insensitive).

This is for me a big problem because involve about a hundred of Stored proc
Any one have a idea to solve this ?

Thanks a lot. PAOLO



Relevant Pages

  • Re: Wieso Tinyint? (Was: Re: Boolescher Datentyp)
    ... root@localhost [kris]> alter table n add column m charcharset latin1 ... Query OK, ... Records: 256 Duplicates: 0 Warnings: 0 ... Collation: utf8_general_ci ...
    (de.comp.datenbanken.mysql)
  • Re: Wieso Tinyint? (Was: Re: Boolescher Datentyp)
    ... Du kannst auch ein CHARNULL verwenden, wenn Du magst. ... Query OK, ... Collation: utf8_general_ci ... root@localhost [kris]> show create table nn\G ...
    (de.comp.datenbanken.mysql)
  • Re: Msg 4104 - thought I had this nailed, but its come back...
    ... The error message is not a collation error. ... You refer to a table in the WHERE clause which hasn't been mentioned in the FROM clause: ... Note that the query isn't complete since, again, there's a table which isn't mentioned in the FROM clause. ...
    (microsoft.public.sqlserver.programming)
  • Re: union all
    ... the UNION ALL query should return the sum of the ... if more than one collation or language setting is involved. ... >>Everything is matching after i remove order by clause. ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL query
    ... Thanks Hugo. ... When I run the query as you suggested, ... >This is caused by the collation setting. ... >SELECT DISTINCT AgtRefNo, AgtTitle, ) ...
    (microsoft.public.sqlserver.programming)

Loading