if exists (
	select 1 from VCLib.T_CLIENT_MODULES
	where ModuleType = 'IESClientCommandUIHandler'
)
begin
	delete from VCLib.T_ROLE_CLIENT_MODULES
	where ClientModuleID in (
		select ClientModuleID from VCLib.T_CLIENT_MODULES
		where ModuleType = 'IESClientCommandUIHandler'
	);

	delete from VCLib.T_CLIENT_MODULES
	where ModuleType = 'IESClientCommandUIHandler';
end