Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Ektron Find Replace In Sitemap

Posted on October 23, 2013October 26, 2015 By David Kittell

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

Originally Posted on October 23, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code Ektron MSSQL MSSQL - Ektron MSSQL - Ektron 8.0.2 SQL

Post navigation

Previous post
Next post

Related Posts

MSSQL – Table/View Column Information

Posted on February 25, 2013October 26, 2015

Similar to MySQL – Table/View Column Information, this post will help with MSSQL tables and columns. exec sp_columns ‘<tablename>’ Cleaner Result: SET NOCOUNT ON DECLARE @tablename NVARCHAR(max) SET @tablename = <tablename> SELECT c.NAME ‘Column Name’ ,t.NAME ‘Data type’ ,c.max_length ‘Max Length’ , –c.precision , –c.scale , CASE c.is_nullable WHEN 0…

Read More

Azure DNS

Posted on April 20, 2018

For VMs Internet access 168.63.129.16 168.62.167.9 For DNS Zones managed in Azure ns1-05.azure-dns.com. ns2-05.azure-dns.net. ns3-05.azure-dns.org. ns4-05.azure-dns.info. All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand…

Read More

Bash – Raspberry Pi – OpenMediaVault – Network Storage

Posted on December 23, 2021August 17, 2024

Start out with a headless (no GUI) Raspberry Pi OS (Raspbian) With the SD Card still mounted in your computer, create a ssh file to start with SSH enabled (Note: no extension, no text) touch ssh After a few seconds of letting the SD Card load in the Raspberry Pi…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes