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 Rename Templates

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

This script will rename template paths

SET XACT_ABORT ON

DECLARE @currval NVARCHAR(500)
DECLARE @newval NVARCHAR(500)
DECLARE @search NVARCHAR(500)
DECLARE @replace NVARCHAR(500)

SET @search = '/Index.aspx' --string to find
SET @replace = '/Default.aspx' --replacement string

DECLARE @pos INT
DECLARE @id BIGINT

BEGIN TRAN

DECLARE curs CURSOR LOCAL FAST_FORWARD
FOR
SELECT template_id
	,template_filename
FROM templates_tbl
WHERE template_filename 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 templates_tbl
	SET template_filename = @newval
	WHERE template_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

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

PHP – WordPress Backup (MySQL & Files)

Posted on February 22, 2016February 23, 2016

After writing WordPress – Backup & Restore I came across a site that I do not have SSH/CLI access to so I needed to have another option. If you have SSH/CLI access it’s best to use the process on WordPress – Backup & Restore. Sometimes you just need a quick…

Read More

Get IP Address

Posted on December 14, 2013November 13, 2015

Public Function GetIPAddress() As String Dim h As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName) Return h.AddressList.GetValue(0).ToString End Function public string GetIPAddress() { string myHost = System.Net.Dns.GetHostName(); string myIP = null; for (int i = 0; i <= System.Net.Dns.GetHostEntry(myHost).AddressList.Length – 1; i++) { if (System.Net.Dns.GetHostEntry(myHost).AddressList[i].IsIPv6LinkLocal == false) { myIP = System.Net.Dns.GetHostEntry(myHost).AddressList[i].ToString(); } } return…

Read More

Mac OSX Terminal – Parallels VM Backup / Restore

Posted on June 28, 2019

If you use Parallels like I do sometimes you need to test things and recover from that test rather quickly. My process is to first build the base/template VM the way I want it and then back it up before testing things. In intervals if I’m going to continue to…

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