declare @connection varchar(255)
declare @src varchar(255)
declare @dst varchar(255)

set @connection='forcopy'
set @src='Server1\djinroot\snd'

update ph set filename=replace(filename, @connection + '\' + @src + '\COMM\', '') where ddb_owner = @connection and type = 1 and archive = 0
update ph set filename=replace(filename, @connection + '\' + @src + '\JNGL\', '') where ddb_owner = @connection and type = 2 and archive = 0
update ph set filename=replace(filename, @connection + '\' + @src + '\MUSIC\', '') where ddb_owner = @connection and type = 3 and archive = 0
update ph set filename=replace(filename, @connection + '\' + @src + '\BCST\', '') where ddb_owner = @connection and type = 4 and archive = 0
update ph set filename=replace(filename, @connection + '\' + @src + '\NEWS\', '') where ddb_owner = @connection and type = 5 and archive = 0
update ph set filename=replace(filename, @connection + '\' + @src + '\ARC\COMM\', '') where ddb_owner = @connection and type = 1 and archive = 1
update ph set filename=replace(filename, @connection + '\' + @src + '\ARC\JNGL\', '') where ddb_owner = @connection and type = 2 and archive = 1
update ph set filename=replace(filename, @connection + '\' + @src + '\ARC\MUSIC\', '') where ddb_owner = @connection and type = 3 and archive = 1
update ph set filename=replace(filename, @connection + '\' + @src + '\ARC\BCST\', '') where ddb_owner = @connection and type = 4 and archive = 1
update ph set filename=replace(filename, @connection + '\' + @src + '\ARC\NEWS\', '') where ddb_owner = @connection and type = 5 and archive = 1

update ph set ddb_owner = null, ddb_id = 0 where ddb_owner = @connection

update attrib_vals set ddb_owner = null where ddb_owner = @connection