作者criky (立业成家)
看板Database
标题[SQL ] Table/View denpency
时间Wed Dec 28 19:48:36 2016
资料库名称:MS SQL, Teradata
内容/问题描述:
想请教在资料库中是否有能看到关联式tabel, view的阶层?
以下方资料为例,
sql的内容是每个查询的主要内容,可以切出
from, insert into, create 指令中的 table
(to) (from)
sql_command from_t insert_t table_t 想整理成 lv obj dep
select ... form t1 t1 0 t1
-----------------------------------------------
insert into t2 t2 1 t2 t1
from t1 t1
-----------------------------------------------
insert into t5 t5 2 t5 t4
select * 1 t4 t3
from t4 t4 0 t3
join
(select ... from t3) t3
-----------------------------------------------
insert into t9 t9 1 t9 t8_1
select * from 1 t9 t8_2
(select ... from t8_1) t8_1 0 t8_1
join 0 t8_2
(select ... from t8_2) t8_2
------------------------------------------------
delete from t11 t11 0 t11
------------------------------------------------
delete from t13 t13 1 t13 t12
(select ... from t12) t12 0 t12
------------------------------------------------
create table new1 new1 1 new1 new
select ... from new new 0 new
------------------------------------------------
create table new2 new2 0 new2
这样整理蛮费工夫的,
想询问是否有类似的指令或工具可以达到此目标?
谢谢~
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 27.147.47.152
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Database/M.1482925720.A.3F8.html
※ 编辑: criky (27.147.47.152), 12/28/2016 19:48:58
※ 编辑: criky (27.147.47.152), 12/28/2016 21:41:51