Author |
Topic |
pnpsql
Posting Yak Master
246 Posts |
Posted - 2012-02-07 : 04:24:16
|
hi team, i have string like '111111~2222~klk' ~ sign is seprator for each item, i need to set values of each item in variables @v1 , @v2 , @v3 , plese helpchallenge everything |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-02-07 : 04:31:22
|
declare @v1 varchar(10)declare @v2 varchar(10)declare @v3 varchar(10)declare @test varchar(255)set @test = '111111~2222~klk'select@v1=parsename(replace(@test,'~','.'),3),@v2=parsename(replace(@test,'~','.'),2),@v3=parsename(replace(@test,'~','.'),1)select @v1,@v2,@v3 No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
pnpsql
Posting Yak Master
246 Posts |
Posted - 2012-02-07 : 04:45:21
|
may contain any null value thenchallenge everything |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-02-07 : 05:01:25
|
If you can give better examples then maybe we can give better solutions... No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
pnpsql
Posting Yak Master
246 Posts |
Posted - 2012-02-07 : 05:02:12
|
'111111~2222~klk' IS NOW '111111~2222~'challenge everything |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-02-07 : 05:08:40
|
declare @v1 varchar(10)declare @v2 varchar(10)declare @v3 varchar(10)declare @test varchar(255)set @test = '111111~2222~'select@v1=replace(parsename(replace(@test,'~','.~'),3),'~',''),@v2=replace(parsename(replace(@test,'~','.~'),2),'~',''),@v3=replace(parsename(replace(@test,'~','.~'),1),'~','')select @v1,@v2,@v3 No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
pnpsql
Posting Yak Master
246 Posts |
Posted - 2012-02-07 : 05:50:46
|
gr8, now there is more than one row seprated by ^ like 'dsdsds~sdsds~fsdsd^sdsd~dsds~^dsds~hdjfhjdh~dsd' then i need to get each row how can this be possiblechallenge everything |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-02-07 : 06:47:52
|
What is "spoon feeding"?Most often on the forums, "spoon feeding" refers to posters who ask questions, and refuse to put any effort or thought into their questions, as well as the answers they receive. They expect every answer to be dumbed down to the last detail, and expect that everyone else do their research for them. This is usually a characteristic of laziness, and not capability. Hence the saying, "I'm not handicapped, I'm just lazy." No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
pnpsql
Posting Yak Master
246 Posts |
Posted - 2012-02-07 : 09:11:34
|
HOW CAN U DEFINE THE LAZYNESS, WHEN PEOPLE HAVE NO ANSWER THEN THEY TALK LIKE THAT..AND THE WAY THE FORUM IS ABOUT THE EXPERIENCE SHARING, AND NOT FOR RESEARCH.challenge everything |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-02-07 : 09:21:56
|
Please don't shout at me...I am not in the mood to answer a question again and again if it will be expanded after each given answer.Please don't be too lazy to describe your problem in a way that we don't have to guess about so many things. No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2012-02-07 : 14:06:38
|
Do bear in mind that we are all unpaid volunteers posting in our spare time. If you want a useful solution, post the full description of the problem. Adding in complications again and again works fine in a mystery novel, but not when you're asking people for free help.--Gail ShawSQL Server MVP |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
X002548
Not Just a Number
15586 Posts |
|
|