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 |
|
outspaced
Starting Member
21 Posts |
Posted - 2006-11-23 : 06:43:59
|
| Hi,I'd like to update a field in my db so that everything to the right of a / is kept.So I want:filename: /path/to/myfile.exeto become: myfile.exeCan I do this just using SQL?Thanks,Alex |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-11-23 : 06:49:11
|
| [code]Update TblSet col = Reverse(substring(reverse(col),1, charindex('/',reverse(col))-1))where col like '%/%'[/code]Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
|
outspaced
Starting Member
21 Posts |
Posted - 2006-11-23 : 06:55:10
|
| Brilliant, thanks very much! |
 |
|
|
|
|
|