Recently I needed to update several areas of our web site with hyperlink changes and content changes. A few examples might include a new referral link from Snowcovered or a new maybe a new product listing. When Dynamic Forms 3.4 was released we probably had over 50 modules on our web site that had the previous hyperlink to the Snowcovered listing. These areas could include text/html modules, module settings, etc... Below is a quick and easy way to update tables in your database with replacing a value.
Note: As Always with any major change you should do a backup!
Here was some of the tables and queries we used to update... This example includes updating maybe a domain name to another alias. For example lets say you wanted to change
www.yourdomain.com in all of your Text/HTML Modules within DotNetNuke to
www.someotherdomain.com. My example below updates the Text/HTML Module, the module settings table, and also our specific Tailored Text/HTML Module.
Update {databaseOwner}{objectQualifier}HTMLText
Set Content = cast(replace(cast(content as nvarchar(max)),'www.yourdomain.com','www.someotherdomain.com') as ntext)
Where Content like '%www.yourdomain.com%'
Update {databaseOwner}{objectQualifier}ModuleSettings
Set SettingValue = cast(replace(cast(SettingValue as nvarchar(max)),'www.yourdomain.com','www.someotherdomain.com') as nvarchar(MAX))
Where SettingValue like '%www.yourdomain.com%'
Update {databaseOwner}{objectQualifier}DataSprings_TailoredHTML
Set DesktopUnAuthorizeHTML = cast(replace(cast(DesktopUnauthorizeHTML as nvarchar(max)),'www.yourdomain.com','www.someotherdomain.com') as nvarchar(MAX))
Where DesktopunAuthorizeHTML LIKE '%www.yourdomain.com%'
Update {databaseOwner}{objectQualifier}DataSprings_TailoredHTML
Set DesktopHTML = cast(replace(cast(DesktopHTML as nvarchar(max)),'www.yourdomain.com','www.someotherdomain.com') as nvarchar(MAX))
Where DesktopHTML LIKE '%www.yourdomain.com%'
Note: This example is specifically for DotNetNuke databases running on SQL Server 2005 or higher. If you are running SQL Server but NOT DotNetNuke, please remove the database owner and object qualifier reference in the queries (the {databaseOwner}{objectQualifier}).
Hope someone finds this useful! Its a great way to update a hyperlink reference or really anything you might want to update on your site.
-Chad