This script will rename menu link paths
SET XACT_ABORT ON DECLARE @currval NVARCHAR(500) DECLARE @newval 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 BEGIN TRAN DECLARE curs CURSOR LOCAL FAST_FORWARD FOR SELECT mnu_id ,item_link FROM menu_to_item_tbl WHERE item_link LIKE '%' + @search + '%' OPEN curs FETCH NEXT FROM curs INTO @id ,@currval WHILE @@fetch_status = 0 BEGIN --print 'Url before update=' + @currval SET @newval = replace(@currval, @search, @replace) UPDATE menu_to_item_tbl SET item_link = @newval WHERE mnu_id = @id PRINT 'Value after update=' + @newval FETCH NEXT FROM curs INTO @id ,@currval 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