Last active
December 18, 2015 09:39
-
-
Save maravilloso/5763111 to your computer and use it in GitHub Desktop.
Listar todas las FK's de la BD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT CAST(a.tabname AS VARCHAR(15)) AS tabla, | |
CAST(constrname AS VARCHAR(20)) AS FK, | |
CAST(d.tabname AS VARCHAR(15)) AS referenciada, | |
delrule | |
FROM systables a, sysconstraints b, sysreferences c, | |
systables d | |
WHERE b.constrtype = 'R' | |
AND a.tabid = b.tabid | |
AND b.constrid = c.constrid | |
AND c.ptabid = d.tabid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment