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 |
|
subhaoviya
Posting Yak Master
135 Posts |
Posted - 2012-06-22 : 06:09:35
|
| Declare @a varchar(50)set @a='1234-76589'how to produce resultseta1 b11234 76589 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-06-22 : 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
135 Posts |
Posted - 2012-06-22 : 07:27:45
|
| thanks friend.I found one more wayDeclare @a varchar(50)set @a='1234-76589'selectsubstring(@a,0,CHARINDEX('-',@a)),SUBSTRING(@a,CHARINDEX('-',@a)+1,len(@a)-1) |
 |
|
|
|
|
|
|
|