Project

General

Profile

DiManDigispotIIKBWrongCleaning » rename_storage.sql

Pavel Konstantinov, 20/04/2010 13:02

 
-- ####################################################################
-- Script for rename big number of files at once.
-- It blocks MDB change notification
-- After execution of the script do full MDB refresh (Ctrl + Refresh icon click)
-- ####################################################################


declare @old_path varchar(250)
declare @new_path varchar(250)

-- Change '\\server\old_path' with real path, that should be replaced
-- Do not type ending \
set @old_path='\\server\old_path'

-- Change '\\server\new_path' with real path, that should be used instead old path
set @new_path='\\cluster\new_path'

-- ####################################################################
-- Do not edit lines below
-- ####################################################################
begin transaction

ALTER TABLE ph DISABLE TRIGGER ModifyPH

update ph set filename= REPLACE ( filename , @old_path , @new_path ) where filename like @old_path+'\%'

ALTER TABLE ph ENABLE TRIGGER ModifyPH

commit transaction
GO
(1-1/2)
Add picture from clipboard (Maximum size: 742 MB)