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)
Thank this author by sharing:
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.
Question regarding naming prefix
Should table names be prefixed with "tab"
How can I default prefix length to 0 for fixed width format file