dbTalk Databases Forums  

changing the case of a field in a table?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss changing the case of a field in a table? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Davy with the Wavy Gravy
 
Posts: n/a

Default changing the case of a field in a table? - 08-12-2004 , 07:07 PM






is there an easy, automated way to change the case of a
field in every record across the database so that it is
changed from whatever it is (ALL CAPS, Title Case, mIXeD
cASe) into Title Case? This is a Name field, and it
should be Firstname Lastname, but there are also
exceptions to that, like suffixes and titles, etc., that
we don't want to lose. Uniformity is what we seek - even
if AleX REeger and SONS is changed to Alex Reeger and
Sons, that's fine.

I know this sounds like a dopey question. Hopefully one of
you will take pity on an aging hippie (taxpaying, non-tree-
hugging variety, who bathes regularly) and hook me up with
a clue? Many thanks.

Reply With Quote
  #2  
Old   
Ilya Margolin
 
Posts: n/a

Default Re: changing the case of a field in a table? - 08-13-2004 , 01:16 PM







Davy with the Wavy Gravy,

No. In a record you would have to loop through the characters looking for
the first after a space and make it upper and the rest lower case. You would
have to take care of exceptions such as MaryAnn, Rogers-Prince, etc.
Enveloping the code into a function would be a convenient way to use it.

Ilya

"Davy with the Wavy Gravy" <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message news:511601c480c9$97b1a4c0$a301280a (AT) phx (DOT) gbl...
Quote:
is there an easy, automated way to change the case of a
field in every record across the database so that it is
changed from whatever it is (ALL CAPS, Title Case, mIXeD
cASe) into Title Case? This is a Name field, and it
should be Firstname Lastname, but there are also
exceptions to that, like suffixes and titles, etc., that
we don't want to lose. Uniformity is what we seek - even
if AleX REeger and SONS is changed to Alex Reeger and
Sons, that's fine.

I know this sounds like a dopey question. Hopefully one of
you will take pity on an aging hippie (taxpaying, non-tree-
hugging variety, who bathes regularly) and hook me up with
a clue? Many thanks.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.