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
Last Updated on October 26, 2015