| Author |
Topic  |
|
|
subhaoviya
Posting Yak Master
India
119 Posts |
Posted - 06/22/2012 : 06:09:35
|
Declare @a varchar(50) set @a='1234-76589' how to produce resultset a1 b1 1234 76589 |
|
|
webfred
Flowing Fount of Yak Knowledge
Germany
8529 Posts |
Posted - 06/22/2012 : 07:08:16
|
Declare @a varchar(50) set @a='1234-76589' select parsename(replace(@a,'-','.'),2) as a1, parsename(replace(@a,'-','.'),1) as b1
No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
subhaoviya
Posting Yak Master
India
119 Posts |
Posted - 06/22/2012 : 07:27:45
|
thanks friend.
I found one more way
Declare @a varchar(50) set @a='1234-76589' select substring(@a,0,CHARINDEX('-',@a)), SUBSTRING(@a,CHARINDEX('-',@a)+1,len(@a)-1) |
 |
|
| |
Topic  |
|
|
|