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 |
|
mike13
Posting Yak Master
219 Posts |
Posted - 2011-10-24 : 16:34:21
|
| Hi all,i need to update a ton of records.Records look like ex:Hoodies/tribal2/hoodie_0135.jpgHoodies/tribal2/big/hoodie_135.jpgi just want to keep the last part of the recordex:hoodie_0135.jpghoodie_135.jpgHow can i do this?thanks a lot |
|
|
vijays3
Constraint Violating Yak Guru
354 Posts |
Posted - 2011-10-24 : 17:11:02
|
| can you provide more sample data? |
 |
|
|
mike13
Posting Yak Master
219 Posts |
Posted - 2011-10-24 : 17:13:07
|
| Hoodies/tribal2/hoodie_0135.jpgHoodies/tribal2/big/hoodie_135.jpgi just want to keep the last part of the recordex:hoodie_0135.jpghoodie_135.jpgit is just cutting the string on the last /in vb i would left("Hoodies/tribal2/big/hoodie_135.jpg",instrrev("/")) |
 |
|
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2011-10-24 : 17:17:49
|
declare @fpath varchar(300)set @fpath = 'Hoodies/tribal2/hoodie_0135.jpg'SELECT REVERSE(SUBSTRING(REVERSE(@fpath), 0, CHARINDEX('/', REVERSE(@fpath), 1))) Success is 10% Intelligence, 70% Determination, and 22% Stupidity.\_/ _/ _/\_/ _/\_/ _/ _/- 881 |
 |
|
|
mike13
Posting Yak Master
219 Posts |
Posted - 2011-10-25 : 02:06:12
|
| Thank a lot Vinnie that did the trick |
 |
|
|
|
|
|