Thursday, March 8, 2012

Change Capitalization in Sql Table Column

I have some data that was entered in the DB in ALL CAPS. I would like to reformat all the rows so that it follows the normal "Capitalization". What is the best way to do this? Shoud I create a console application to accomplish this or is there some way to do it natively in sql server 2005.

Here's a script that converts a given string to proper case, but you'd somehow need to incorporate that into another routine that runs through all of your tables.

http://vyaskn.tripod.com/code/propercase.txt

|||

This is a good example but will work very slow ( it process word char by char) and it will not work with special cases like McDonald ,DaVinci, VanDerVals and so on. The better way is to split words by spaces and next process each word separately with specific logic which will take care about some or all possible scenarios.

But it will be very big project.

No comments:

Post a Comment