dbTalk Databases Forums  

SSIS - String "Proper" Case (First Letter Capitilized for Each Wor

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


Discuss SSIS - String "Proper" Case (First Letter Capitilized for Each Wor in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dave L
 
Posts: n/a

Default SSIS - String "Proper" Case (First Letter Capitilized for Each Wor - 11-02-2005 , 09:45 PM






Anyway to set a column in SSIS in proper case format (i.e, captilize the
first letter in each word. Was hoping on a function within the conversion
or derived data transformation tasks

Change JOHN SMITH to John Smith

thanks,

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: SSIS - String "Proper" Case (First Letter Capitilized for Each Wor - 11-03-2005 , 12:40 AM






There is no "Proper Case" transformation but you could certainly easily
create your own in a custom component or even using the Script component
as a transform.

Allan






"Dave L" <DaveL (AT) discussions (DOT) microsoft.com> wrote


Quote:
Anyway to set a column in SSIS in proper case format (i.e, captilize the
first letter in each word. Was hoping on a function within the
conversion
or derived data transformation tasks

Change JOHN SMITH to John Smith

thanks,


Reply With Quote
  #3  
Old   
Darren Green
 
Posts: n/a

Default Re: SSIS - String "Proper" Case (First Letter Capitilized for Each Wor - 11-03-2005 , 04:29 AM



The Framework has a Title case method somewhere in System.Text I seem to
recall. This could be leveraged in a Script Transform without too much
hassle.

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
There is no "Proper Case" transformation but you could certainly easily
create your own in a custom component or even using the Script component
as a transform.

Allan






"Dave L" <DaveL (AT) discussions (DOT) microsoft.com> wrote in message
news:65BE35B3-21B8-42A0-8B62-DAAAD4E5C681 (AT) microsoft (DOT) com:

Anyway to set a column in SSIS in proper case format (i.e, captilize the
first letter in each word. Was hoping on a function within the
conversion
or derived data transformation tasks

Change JOHN SMITH to John Smith

thanks,




Reply With Quote
  #4  
Old   
Ricky
 
Posts: n/a

Default Re: SSIS - String "Proper" Case (First Letter Capitilized for Each Wor - 11-03-2005 , 07:53 AM



You could try the following:

CREATE FUNCTION fn_TitleCase (@instr varchar(1000))
RETURNS varchar(1000)
AS
Begin
Declare @Pos integer

If @instr Is Null Return @instr
If Len(@instr)=0 Return @instr

Set @instr= Upper(Substring(@instr,1,1)) +
Substring(@instr,2,Len(@instr)-1)
Set @Pos = 2
While @Pos < Len(@instr)+1
Begin
if Substring(@instr,@Pos-1,1)=' ' Or Substring(@instr,@Pos-1,1)='.'
Set @instr= Substring(@instr,1,@Pos-1)
+ Upper(Substring(@instr,@Pos,1))
+ Substring(@instr,@Pos+1,Len(@instr)-@Pos)
Else
Set @instr= Substring(@instr,1,@Pos-1)
+ Lower(Substring(@instr,@Pos,1))
+ Substring(@instr,@Pos+1,Len(@instr)-@Pos)
Set @Pos=@Pos+1
End
Return @instr
End




"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

Quote:
The Framework has a Title case method somewhere in System.Text I seem to
recall. This could be leveraged in a Script Transform without too much
hassle.

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:e%23eq0FE4FHA.400 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
There is no "Proper Case" transformation but you could certainly easily
create your own in a custom component or even using the Script component
as a transform.

Allan






"Dave L" <DaveL (AT) discussions (DOT) microsoft.com> wrote in message
news:65BE35B3-21B8-42A0-8B62-DAAAD4E5C681 (AT) microsoft (DOT) com:

Anyway to set a column in SSIS in proper case format (i.e, captilize
the
first letter in each word. Was hoping on a function within the
conversion
or derived data transformation tasks

Change JOHN SMITH to John Smith

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.