|
Posted by Erland Sommarskog on 10/01/03 11:19
[posted and mailed, please reply in news]
Duy Lam (duylam@gmail.com) writes:
> I'm using collation SQL_Latin1_General_CP1_CI_AS and I need to sort a
> varchar field. There are some elements, however, that I want to come
> AFTER any alphabetic characters. Is there any character that sorts
> after "Z"? In normal ASCII, there are various characters that would
> sort after "Z" (e.g. "~"), but I can't seem to figure out what the case
> would be in the SQL_Latin1_General_CP1_CI_AS collation. Any ideas?
Looks like you have to learn Icelandic. :-) The script below helps you
out:
CREATE TABLE slafs (a int IDENTITY,
b AS char(a),
c int NOT NULL)
go
INSERT slafs (c) SELECT TOP 255 OrderID FROM Northwind..Orders
go
SELECT * FROM slafs ORDER BY b
SELECT * FROM slafs ORDER BY b COLLATE SQL_Latin1_General_CP1_CI_AS
go
DROP TABLE slafs
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Navigation:
[Reply to this message]
|