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 Library

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

This script will search and replace specific library links

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

BEGIN TRAN

DECLARE curs CURSOR LOCAL FAST_FORWARD
FOR
SELECT lib_id
	,[filename]
FROM library
WHERE [filename] LIKE '%' + @search + '%'

OPEN curs

FETCH NEXT
FROM curs
INTO @id
	,@currurl

WHILE @@fetch_status = 0
BEGIN
	--print 'Url before update=' + @currurl
	SET @newurl = replace(@currurl, @search, @replace)

	UPDATE library
	SET [filename] = @newurl
	WHERE lib_id = @id

	PRINT 'Url after update=' + @newurl

	FETCH NEXT
	FROM curs
	INTO @id
		,@currurl
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

HTML5 Geolocation

Posted on November 5, 2013October 26, 2015

[raw] Click the button to get your coordinates: Try It [/raw] <!DOCTYPE html> <html> <body> <p id="demo">Click the button to get your coordinates:</p> <button onclick="getLocation()">Try It</button> <script> var x=document.getElementById("demo"); function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else{x.innerHTML="Geolocation is not supported by this browser.";} } function showPosition(position) { x.innerHTML="Latitude: "…

Read More

Form Action Page

Posted on December 17, 2013October 26, 2015

This page will walk you through how to build one action page to handle various forms. WORK IN PROCESS! Form HTML fields should start with “form_” for this to work. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Configuration; using System.Collections.Specialized; protected void Submit_Click(object sender,…

Read More

MySQL – Table/View Column Information

Posted on March 1, 2014October 26, 2015

Similar to MSSQL – Table/View Column Information, this post will help with MySQL tables and columns. This query is a quick query to give you the pertinent information about a specific table. DESCRIBE <Table Name>; select * from `information_schema`.`columns` WHERE table_name = ‘<Table Name>’; SELECT table_name, Replace(GROUP_CONCAT(CONCAT(column_name, ‘, ‘, table_name)),CONCAT(‘,…

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