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 |
|
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2011-10-06 : 12:19:06
|
| i want to update the english text column, just want to remove the last two chars which is space and 'v'" v" before updating if the last two charecters are a space and v then remove just the last two letters only. keep the rest same.i have almost 2200 rows in this table.declare @Sample table (ID int, englishtext)insert @Sampleselect 1, 'MyText1 v' union allselect 2, 'mytext2 v' union allselect 3, 'mytext3' union allselect 4, 'mytext4 v' union allselect 5, 'mytext5' union allselect 6, mytext6' union allselect 7, 'mytext7 v'once i do the update it should be:Mytext1MyText2Mytext3Mytext4Mytext5Mytext6Mytext7Update @Sample set englishtext=Thank you very much for the helpful info |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-06 : 12:23:55
|
| [code]Update @Sample set englishtext=left(englishtext,len(englishtext)-2)where patindex('% v',englishtext) >0[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|