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 |
|
baska123
Yak Posting Veteran
64 Posts |
Posted - 2007-04-18 : 11:53:38
|
| This is the first time I am trying to write script, so any help is appreciated.I would like to write a script that will do the following:Will change one letter in a string and will add on one letter to it.For example in a table called Idea column Project_documentPath change the following fromhttp://PIMSPS01:90/sites/ProjectServer_586 tohttp://TIMSPS01V:90/sites/ProjectServer_586I need to iterate through all the rows to change the info.Thanx |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-04-18 : 11:57:55
|
[code]update tableset Project_documentPath = replace(Project_documentPath, 'PIMSPS01', 'TIMSPS01V')[/code] KH |
 |
|
|
pootle_flump
1064 Posts |
Posted - 2007-04-18 : 12:00:35
|
quote: Originally posted by baska123 I need to iterate through all the rows to change the info.
No you don'tUPDATE MyTableSET MyCol = REPLACE(MyCol, 'http://PIMSPS01:', 'http://TIMSPS01V:')WHERE MyCol LIKE 'http://PIMSPS01:%' HTH |
 |
|
|
pootle_flump
1064 Posts |
Posted - 2007-04-18 : 12:01:20
|
Poop |
 |
|
|
baska123
Yak Posting Veteran
64 Posts |
Posted - 2007-04-18 : 13:22:05
|
| Thank you for your help |
 |
|
|
|
|
|