This script will search and replace sitemap links/titles/etc
set xact_abort on declare @currurl nvarchar(500) declare @newurl nvarchar(500) declare @search nvarchar(500) declare @replace varchar(500) set @search = '' --string to find set @replace = '' --replacement string declare @pos int declare @id bigint declare @ol int declare @lang int begin tran declare curs cursor local fast_forward for select FolderId,Url,OrderLocation,ContentLanguage from sitemap where url like '%' + @search +'%' open curs fetch next from curs into @id,@currurl,@ol,@lang while @@fetch_status = 0 begin --print 'Url before update=' + @currurl Set @newurl = replace(@currurl,@search,@replace) Update SiteMap Set Url = @newurl where folderid = @id and orderlocation = @ol and contentlanguage = @lang --print 'Url after update=' + @newurl fetch next from curs into @id,@currurl,@ol,@lang end close curs deallocate curs --rollback tran commit tran
Source: http://www.skonet.com/Articles_Archive/Helpful_Sql_Scripts_for_Ektron_CMS_400_Net.aspx
Last Updated on October 26, 2015