|
|
Archives of the TeradataForum
Message Posted: Fri, 18 Nov 2011 @ 09:43:20 GMT
Subj: | | Re: How to find the associated tables or view in teradata? |
|
From: | | Gorner, Tomas |
Hi Vijay,
This how TD Administrator does it:
SELECT DatabaseName,TVMName,TableKind AS "Type"
FROM dbc.TVM T,dbc.dbase D
WHERE D.DatabaseId=T.DatabaseId
AND CreateText LIKE '%"DBC"."DBQLSqlTbl"%' (NOT CS)
UNION
SELECT DatabaseName,TVMName,TableKind AS "Type"
FROM dbc.TextTbl X,dbc.dbase D,dbc.TVM T
WHERE X.TextType='C'
AND X.TextString LIKE '%"DBC"."DBQLSqlTbl"%' (NOT CS)
AND X.DatabaseId=D.DatabaseId
AND X.TextId=T.TVMId
MINUS
SELECT DatabaseName,TVMName,TableKind
FROM dbc.TVM T,dbc.dbase D
WHERE D.DatabaseId=T.DatabaseId
AND DatabaseName='DBC'
AND TVMName='DBQLSqlTbl'
ORDER BY 1,2
;
Regards,
Tomas
| |