This script will rename manual aliases
set xact_abort on declare @currval nvarchar(500) declare @newval nvarchar(500) declare @search nvarchar(500) declare @replace varchar(500) set @search = '/Index' --string to find set @replace = '/Default' --replacement string declare @pos int declare @id bigint begin tran declare curs cursor local fast_forward for select AliasId,AliasName from UrlAliasManual_Tbl where AliasName 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 UrlAliasManual_Tbl Set AliasName = @newval where AliasId = @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