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?
thanks,
Duy Lam 3 12301
"Duy Lam" <du****@gmail.com> wrote in message
news:11********************@f14g2000cwb.googlegrou ps.com... 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?
thanks, Duy Lam
Perhaps you can post a specific script to show what you want? Many
characters might sort after 'Z', as you said - maybe you should check out
ASCII(), CHAR(), UNICODE(), COLLATE and "Using Unicode Data" in Books
Online? If you can post something that others can copy and paste into Query
Analyzer, then there's a better chance that you'll get a useful answer. http://www.aspfaq.com/etiquette.asp?id=5006
Simon
Well, it's not so much there's a specific script I have that I need to
get working. I just want a way to enforce a certain order among rows.
For instance, let's say I have a table
T(someindex int, sortkey varchar(5), val int)
....and it's loaded with some data. for each row, the "sortkey" is a
field so that a user (who's using my app) can manually enforce an order
among "val"s. Normally it will be filled with some kind of alphanumeric
data.
I want to return the "val" column, but ordered by "sortkey". This, of
course, is easily obtained by running:
SELECT val FROM T ORDER BY sortkey
but for some rows, I may want to force certain "val"s to appear at the
end. One way, of course, is to set sortkey to "ZZZZZ" for those vals,
but there might be a chance that "ZZZZZ" is an actual value set by the
user. Thus I want some kind of character that is sorted even lower than
"Z" to guarantee that it comes after any possible alphanumeric entry
for "sortkey".
as i mentioned, in ASCII there are a number of characters that follow
'z', but I don't know any for the standard SQL_Latin1_General_CP1_CI_AS
collation.
[posted and mailed, please reply in news]
Duy Lam (du****@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, es****@sommarskog.se
Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Erlend Fuglum |
last post by:
Hi everyone,
I'm having some trouble sorting lists. I suspect this might have
something to do with locale settings and/or character
encoding/unicode.
Consider the following example, text...
|
by: pmud |
last post by:
Hi,
I am using teh following code for sorting the data grid but it doesnt work.
I have set the auto generate columns to false. & set the sort expression for
each field as the anme of that...
|
by: Federico G. Babelis |
last post by:
Hi All:
I have this line of code, but the syntax check in VB.NET 2003 and also in
VB.NET 2005 Beta 2 shows as unknown:
Dim local4 As Byte
Fixed(local4 = AddressOf dest(offset))
...
|
by: mike |
last post by:
If I had a date in the format "01-Jan-05" it does not sort properly
with my sort routine:
function compareDate(a,b)
{
var date_a = new Date(a);
var date_b = new Date(b);
if (date_a < date_b)...
|
by: SilverWolf |
last post by:
I need some help with sorting and shuffling array of strings. I can't
seem to get qsort working, and I don't even know how to start to shuffle
the array. Here is what I have for now:
#include...
| |
by: Owen T. Soroke |
last post by:
Using VB.NET
I have a ListView with several columns.
Two columns contain integer values, while the remaining contain string
values.
I am confused as to how I would provide functionality to...
|
by: Dennis Gearon |
last post by:
This is what has to be eventually done:(as sybase, and probably others do it)
http://www.ianywhere.com/whitepapers/unicode.html
I'm not sure how that will affect LIKE and REGEX.
...
|
by: Dylan Parry |
last post by:
Hi folks,
I have a database that contains records with IDs like "H1, H2, H3, ...,
Hn" and these refer to local government policy numbers. For example, H1
might be "Housing Policy 1" and so on....
|
by: apattin |
last post by:
HI all,
Can someone explain this sorting issue?
we are using V8 on Windows, but database *might* have been created
with V7 (I can find out if it really matters)
I have a table with one...
|
by: arnuld |
last post by:
1st I think of creating an array of pointers of size 100 as this is the
maximum input I intend to take. I can create a fixed size array but in the
end I want my array to expand at run-time to fit...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |