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 |
|
batcater98
Starting Member
22 Posts |
Posted - 2008-01-03 : 09:48:22
|
| I am wanting to update a portion of a string in a field while leaving the rest of the string as is.Example:ftp://mydata/is/Year_2007/here.datI want to change just the 2007 to 2008 and leave the rest in tack. I need to do this over multiple records.Suggestions. |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-01-03 : 09:50:11
|
| [code]update tableset col = replace(col, ' 2007/', ' 2008/')Where <condition>[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2008-01-03 : 09:50:42
|
EDIT: update <yourTable> set<column> = replace(<column>, 'Year 2007', 'Year 2008')Be One with the OptimizerTG |
 |
|
|
batcater98
Starting Member
22 Posts |
Posted - 2008-01-03 : 10:09:45
|
| Thanks for the quick reply - that is exactly what I was needing. |
 |
|
|
|
|
|