delete from es_datatable where dtName='无效表的表名' and isView=0 and builtIn=0
delete from es_viewtable where dtId not in (select dtId from es_datatable)
delete from es_datafield where dtId not in (select dtId from es_datatable)
PS:select * from es_datatable
where dtId not in (select dtId from es_rtts)
and isView=0 and builtIn=0//含通过外部数据源功能已注册的表
select * from es_datatable
where dtId not in (select dtId from es_rtts)
and isView=0 and builtIn=0 and dsId=0