Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Proper Case

Author  Topic 

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2008-12-17 : 06:38:41
I want Data in ProperCase in any coloumn like i have a coloumn named Country i like to have data in proper case in that Coloumn,,,
Like if i Have ,,,
MALAYSIA like that then i like to have Malaysia..
am Using sql 2000 for that..for the all fields..


Thanks In Advance..

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-17 : 06:40:12
this is a presentation issue and its recommended to do it at front end application where you've formatting functions available.

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-17 : 06:41:48
and if you want to do it sql, its really ugly

SELECT UPPER(LEFT(field,1)) + LOWER(SUBSTRING(field,2,LEN(field)) FROM table
Go to Top of Page

darkdusky
Aged Yak Warrior

591 Posts

Posted - 2008-12-17 : 09:07:48
If you need more than one word converted:
http://blog.sqlauthority.com/2007/02/01/sql-server-udf-function-to-convert-text-string-to-title-case-proper-case/
Go to Top of Page

sshelper
Posting Yak Master

216 Posts

Posted - 2008-12-17 : 12:29:29
Here's a link to a similar user-defined function, called InitCap, to emulate the InitCap function of Oracle:

http://www.sql-server-helper.com/functions/initcap.aspx

SQL Server Helper
http://www.sql-server-helper.com
Go to Top of Page

hanbingl
Aged Yak Warrior

652 Posts

Posted - 2008-12-17 : 13:28:14
your performance is going to suffer really really bad using propercase functions.
Go to Top of Page

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2008-12-18 : 01:44:10
Thanks to u all for replying to me....
Thanks to all for valuable suggestions
Go to Top of Page
   

- Advertisement -