Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Set Proper Name Case Function

By K2mission,

This script is basic in terms of how much it can handle. It sets the proper case in a "full name" field (i.e. First, Middle and Last names all in one column such as 'BILL MCDOUGLE' or 'terry smith-wenderling'. The function will take any case and set it appropriately including last names with the 'Mc' prefix.

There are some limitations.
1) It can't handle middle names if there is a last name prefix of 'Mc' such as 'McDougle'.
2) I haven't spent any additional time with other last name prefixes such as 'O' in "O'Brien" or 'Di' in 'DiNatale'
3) It is unable to handle bad data such as hyphens at the end of the string with only a single name.

Feel free to expand on this. If you're able to modify it to handle any of the limitations, please email me the update [Steven_Kielkucki@harte-hanks.com]. I would appreciate it.

Total article views: 342 | Views in the last 30 days: 5
 
Related Articles
FORUM

Stored procedure naming prefix

Question regarding naming prefix

FORUM

Prefixing table names with "tab"

Should table names be prefixed with "tab"

FORUM

Format File 9.0 Prefix Length

How can I default prefix length to 0 for fixed width format file

FORUM

Sql_Handle

Sql_Handle

FORUM

SQL Handle

SQL Handle

Tags
miscellaneous    
t-sql    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones