Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Setup / March 2006

Tip: Looking for answers? Try searching our database.

Collate

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sandro Brigantini - 28 Mar 2006 16:01 GMT
How can i configure a column collation to only accept uppercase ?
Gail Erickson [MS] - 28 Mar 2006 18:59 GMT
> How can i configure a column collation to only accept uppercase ?
Hi Sandro,

Collation determines how characters strings are sorted and compared and
cannot be used to enforce uppercase data.  What you want to use is the UPPER
function. You can use UPPER to convert the data entered by your users to all
upper case.

USE AdventureWorks;
GO
SELECT UPPER(RTRIM(LastName)) + ', ' + FirstName AS Name
FROM Person.Contact
ORDER BY LastName;
GO

See  the Books Online topic on UPPER for details.

Regards,
Signature

Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights

> How can i configure a column collation to only accept uppercase ?
Sandro Brigantini - 28 Mar 2006 19:36 GMT
Help topic:

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/56483d24-add7-483d-9b96-c6fda460ddbc.htm
""""""
<SQL_collation_name> :: =
    SQL_SortRules[_Pref]_CPCodepage_<ComparisonStyle>

Pref
Specifies uppercase preference."""""

how use clausule "_Pref" ?

> > How can i configure a column collation to only accept uppercase ?
> Hi Sandro,
[quoted text clipped - 15 lines]
> Regards,
> > How can i configure a column collation to only accept uppercase ?
Gail Erickson [MS] - 29 Mar 2006 00:45 GMT
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/56483d24-add7-483d-9b96-c6fda460ddbc.htm
> Pref
> Specifies uppercase preference."""""
>
> how use clausule "_Pref" ?

Select a collation from the list in the topic you referenced that contains
the Pref clause and apply that collation to the table column. A collation
can be applied to the column definition or it can be specified in a query.
Here are a couple of examples:

CREATE TABLE Test1
(C1 int, C2 nvarchar(30)COLLATE SQL_Latin1_General_Pref_CP1_CI_AS)
GO

SELECT C1, C2
FROM Test1
ORDER BY C2 COLLATE SQL_Latin1_General_Pref_CP1_CI_AS

Here's a definition of the uppercace preference value from the book 'Inside
SQL Server 2000'. "Uppercase preference can be specified only with a
case-insensitive sort order, and it means that although 'A' and 'a' are
treated as equivalent for comparisons, 'A' is sorted before 'a'. "

Is that really what you want to do? Your original question was " How can i
configure a column collation to only accept uppercase ? "    My
interpretation of your question is that you want to limit the data in the
column to only uppercase characters.  If that is true, then changing the
collation to one that has an uppercase preference is not going to work and
using the UPPER function is the right answer.  If that's not what you want
to do, perhaps you can clarify what you are trying to do.

Signature

Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights

> Help topic:
>
[quoted text clipped - 29 lines]
>> Regards,
>> > How can i configure a column collation to only accept uppercase ?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.