Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
tdk1964
Starting Member
1 Post |
Posted - 2010-12-02 : 09:20:51
|
I wonder if anyone could help me with a problem I'm having.I have some data in a table that contains many joined words e.g. ThisIsASampleWhat I would like to to is change it to read This Is A SampleI have about 5,000 records and don't want to do it manually but cannot figure out how to do it :( |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-12-02 : 09:36:21
|
declare @test varchar(255)set @test = 'ThisIsATest'declare @ascii intset @ascii=65while @ascii <= 90beginset @test = replace(@test collate SQL_Latin1_General_CP1_CS_AS,char(@ascii),' '+char(@ascii)) set @ascii = @ascii + 1endset @test = ltrim(@test)select @test-- result-- 'This Is A Test' No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
Sachin.Nand
2937 Posts |
Posted - 2010-12-02 : 09:40:23
|
But are you sure the start of the word will be in uppercase for which you want to split the string?PBUH |
 |
|
|
|
|