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 |
|
aoriju
Posting Yak Master
156 Posts |
Posted - 2011-11-03 : 05:46:51
|
| Hi all,I have a small QueryDeclare @test VARCHAR(1000);After some select this @test contains values like ';test1;test2;test3;'i want to get answer like'test1;test2;test3;' ....only need to remove first ;please help ASAP |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-11-03 : 06:00:23
|
STUFF() is your friend No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-11-03 : 06:04:35
|
| select case when @test like ';%' then substring(@test,2,len(@test)) else @test endMadhivananFailing to plan is Planning to fail |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-11-03 : 06:07:10
|
quote: Originally posted by madhivanan select case when @test like ';%' then substring(@test,2,len(@test)) else @test endMadhivananFailing to plan is Planning to fail
I mean using STUFF() while building the value of @test... No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|