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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 need help

Author  Topic 

shaggy
Posting Yak Master

248 Posts

Posted - 2009-10-12 : 06:31:07
Hi friends,

My input is 'Multples_1ST_0000010201'

I want reSult like this

Multples 1ST 0000010201

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2009-10-12 : 06:32:45
select
'Multples_1ST_0000010201'
,replace('Multples_1ST_0000010201','_', ' ')
Go to Top of Page

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-10-12 : 06:32:49
Hi,
Try this once

Select Replace('Multples_1ST_0000010201','_',' ')
Go to Top of Page

shaggy
Posting Yak Master

248 Posts

Posted - 2009-10-12 : 06:37:22
i want as 3 columns
Multples as 'col1' 1ST as 'col2' 0000010201 as 'col3'
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-10-12 : 06:41:57
quote:
Originally posted by shaggy

i want as 3 columns
Multples as 'col1' 1ST as 'col2' 0000010201 as 'col3'



Try this

select parsename(replace('Multples_1ST_0000010201','_','.'),3) as col1,
parsename(replace('Multples_1ST_0000010201','_','.'),2) as col2,
parsename(replace('Multples_1ST_0000010201','_','.'),1) as col3

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

shaggy
Posting Yak Master

248 Posts

Posted - 2009-10-12 : 06:44:12
thanks senthil
Go to Top of Page
   

- Advertisement -