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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 T SQL script

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 from
http://PIMSPS01:90/sites/ProjectServer_586 to
http://TIMSPS01V:90/sites/ProjectServer_586
I 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 table
set Project_documentPath = replace(Project_documentPath, 'PIMSPS01', 'TIMSPS01V')
[/code]


KH

Go to Top of Page

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't
UPDATE MyTable
SET MyCol = REPLACE(MyCol, 'http://PIMSPS01:', 'http://TIMSPS01V:')
WHERE MyCol LIKE 'http://PIMSPS01:%'


HTH
Go to Top of Page

pootle_flump

1064 Posts

Posted - 2007-04-18 : 12:01:20
Poop
Go to Top of Page

baska123
Yak Posting Veteran

64 Posts

Posted - 2007-04-18 : 13:22:05
Thank you for your help
Go to Top of Page
   

- Advertisement -