Did you know you could easily change a part of a string in a value ? Lets say , on day 1 your document database had links to server ‘\\server01\documents’ and, the storage guys decided you should now host everything on server 4. You go like ‘oh , really ????? ‘ no problem. Fire up your t-sql interpreter and look for the table containing your links. Lets say table DBO.DocLink in the Documents Database.
Sql allowas you to use the replace function. Based on your input it will loop trough the table and replace all instances of a string with a new value you decided leaving the rest of the string in the database in tact ! Nifty huh!
--example
-----------------------------
--Database : Documents
--Table Dbo.DocLinks
--Column DOcumentLocation
-----------------------------
Use Documents
go
update DBO.DocLinks
set DocumentLocation = replace(DocumentLocation,'server01','server04')
