Tuesday, March 20, 2012

Can I change Sort order configuration for a single column?

Hi,
I wanted to know, if there is a way to change the sort order (Collation) for a particular column. Assuming, sql server is configured for Case Insensitive, can I change the sort order to "Case sensitive" for a single column or object, retaining the entire sql server instance to Case insenstive
Thank
GYKTry COLLATE.
USE NORTHWIND
select * from orders
order by shipname COLLATE Latin1_General_CS_AS
There is a lot to read about in BO.
cheers,
Herbert Albert
"GYK" <anonymous@.discussions.microsoft.com> schrieb im Newsbeitrag
news:E309852D-B260-441A-BB31-676AA92D2346@.microsoft.com...
> Hi,
> I wanted to know, if there is a way to change the sort order (Collation)
for a particular column. Assuming, sql server is configured for Case
Insensitive, can I change the sort order to "Case sensitive" for a single
column or object, retaining the entire sql server instance to Case
insenstive ?
> Thanks
> GYK|||Yes, you can do that using ALTER TABLE ... ALTER COLUMN and specify the
desired collation. Or specify collation in the query, as per Herbert's
example.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"GYK" <anonymous@.discussions.microsoft.com> wrote in message
news:E309852D-B260-441A-BB31-676AA92D2346@.microsoft.com...
> Hi,
> I wanted to know, if there is a way to change the sort order (Collation)
for a particular column. Assuming, sql server is configured for Case
Insensitive, can I change the sort order to "Case sensitive" for a single
column or object, retaining the entire sql server instance to Case
insenstive ?
> Thanks
> GYK|||Great...
Thanks a lot to you guys
GYK|||HI,
I have one more question. Can a collation be set for a user session? That is I logon with a particular collation, and it becomes invalid, once I logout... :-)
Thanks agai
GY|||Unfortunately not. Consider sending a request for such a feature to
sqlwish@.microsoft.com.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"GYK" <anonymous@.discussions.microsoft.com> wrote in message
news:714D7DFF-E243-4B19-9545-F76BF40E475B@.microsoft.com...
> HI,
> I have one more question. Can a collation be set for a user session? That
is I logon with a particular collation, and it becomes invalid, once I
logout... :-)
> Thanks again
> GYK
>

No comments:

Post a Comment