Re: SELECT . . . ORDER BY - SQL 2000 vs. JET 4

From: Frank (fnoell_cisi_at_hotmail.com)
Date: 07/12/04


Date: Mon, 12 Jul 2004 16:04:06 -0700

Gee... Magic! Now I have to remove all of my bubble sort code (all 17
lines).

Thank you for the "clean" way to handle this!

Note. I've been programming for 34 years, and every time I start using
something new (to me), or sit at a new operating system, it's "newbie" time
all over. Thank goodness there are people like you to help! Much of the
stuff that I have become a "guru" on is hardly, if at all, used. You gotta
keep marching on.....

Frank

"Steve Kass" <skass@drew.edu> wrote in message
news:eEgSpq6ZEHA.4032@TK2MSFTNGP11.phx.gbl...
> Frank,
>
> As in my example, you can add
>
> collate Latin1_General_CI_AI
>
> in the ORDER BY clause to change the sort order. You can also declare
> table columns with that same COLLATE clause (though I used the "wrong"
> one below to imitate what is probably going on for you). If you declare
> the table columns with COLLATE, then any indexes built on those columns
> will respect the collation and can be used to optimize your queries. If
> you do this, you do not need COLLATE in the ORDER BY clause. You can
> also change the default collation for an entire database, which will
> affect the collation applied to newly-declared tables:
>
> ALTER DATABASE yourDatabase COLLATE Latin1_General_CI_AI
>
> You can also specify the collation for an entire instance of SQL Server,
> but only when the instance is first installed. If the instance
> collation is different from the one for your database or particular
> columns, the "wrong" collation will still be used for temporary tables
> (unless you specify otherwise) and perhaps in other places that could
> have an effect on performance.
>
> SK



Relevant Pages

  • RE: sql2k Collation problems.
    ... and variables are assigned the default collation of the database* ... you can specify a default collation for each new database you ... "Change the collation of the master database in SQL Server 2000" section. ...
    (microsoft.public.sqlserver.setup)
  • Re: SELECT . . . ORDER BY - SQL 2000 vs. JET 4
    ... You can also declare ... >>will respect the collation and can be used to optimize your queries. ... >>also change the default collation for an entire database, ... >>You can also specify the collation for an entire instance of SQL Server, ...
    (microsoft.public.sqlserver.programming)
  • Re: SELECT . . . ORDER BY - SQL 2000 vs. JET 4
    ... Frank ... > will respect the collation and can be used to optimize your queries. ... > also change the default collation for an entire database, ... > You can also specify the collation for an entire instance of SQL Server, ...
    (microsoft.public.sqlserver.programming)
  • Re: SELECT . . . ORDER BY - SQL 2000 vs. JET 4
    ... You can also declare ... >>will respect the collation and can be used to optimize your queries. ... >>also change the default collation for an entire database, ... >>You can also specify the collation for an entire instance of SQL Server, ...
    (microsoft.public.sqlserver.programming)
  • Re: Change field collation
    ... constraints and statistics on the columns before you can alter ... There are quite a lot of caveats and you use this script at your own risk. ... Changing the collation of the existing tables is unfortunately not very ... You might consider using SEM to script out the objects in the database, ...
    (microsoft.public.sqlserver.programming)