Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Got error with "Order by" in query

Author  Topic 

hapytran
Starting Member

8 Posts

Posted - 2008-11-17 : 22:49:19
Hi,

I got an error when using order in query (MS SQL 2005). Please see image below:



What the problem is?

Thanks.

karthickbabu
Posting Yak Master

151 Posts

Posted - 2008-11-17 : 23:12:57


Can you post that Query?

====================================================
you realize you've made a mistake, take immediate steps to correct it.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-18 : 00:07:13
whats the collation used?
Go to Top of Page

hapytran
Starting Member

8 Posts

Posted - 2008-11-18 : 01:15:12
quote:
Originally posted by visakh16

whats the collation used?



You can the picture, the quey there.
Go to Top of Page

karthickbabu
Posting Yak Master

151 Posts

Posted - 2008-11-18 : 01:16:07
I can't see that picture.

====================================================
you realize you've made a mistake, take immediate steps to correct it.
Go to Top of Page

hapytran
Starting Member

8 Posts

Posted - 2008-11-18 : 01:16:09
quote:
Originally posted by visakh16

whats the collation used?



SQL_Latin1_General_CP1_CI_AS
Go to Top of Page

hapytran
Starting Member

8 Posts

Posted - 2008-11-18 : 01:17:13
quote:
Originally posted by karthickbabu

I can't see that picture.

====================================================
you realize you've made a mistake, take immediate steps to correct it.




The query is "select * from Zones order by [Name]"
Go to Top of Page

hapytran
Starting Member

8 Posts

Posted - 2008-11-18 : 01:30:08
It works when I try "select * from Zones order by Name collate SQL_Latin1_General_CP1_CI_AS". Strange!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-18 : 03:19:50
quote:
Originally posted by hapytran

It works when I try "select * from Zones order by Name collate SQL_Latin1_General_CP1_CI_AS". Strange!


thats means its problem with collation. due to some reason its interpreting collation as something else. Can you just check definition of table to see if collation of Name field was actually
SQL_Latin1_General_CP1_CI_AS?
Go to Top of Page

hapytran
Starting Member

8 Posts

Posted - 2008-11-18 : 20:34:07
quote:
Originally posted by visakh16

quote:
Originally posted by hapytran

It works when I try "select * from Zones order by Name collate SQL_Latin1_General_CP1_CI_AS". Strange!


thats means its problem with collation. due to some reason its interpreting collation as something else. Can you just check definition of table to see if collation of Name field was actually
SQL_Latin1_General_CP1_CI_AS?



Yeah, the collation of Name field is not SQL_Latin1_General_CP1_CI_AS.

Thanks
Go to Top of Page
   

- Advertisement -