728x90
select A.NAME, A.ID, A.PARENT_OBJ, A.XTYPE, B.NAME, B.ID, B.PARENT_OBJ, B.XTYPE, C.NAME INDEX이
름, D.NAME COLUMN이름
from (SELECT * FROM sysobjects WHERE xtype ='U') A
     LEFT OUTER JOIN (SELECT * FROM SYSOBJECTS WHERE xtype in ('PK','UQ','C','F')) B ON A.ID
=B.PARENT_OBJ
     INNER JOIN SYSINDEXES C ON A.ID = C.ID
     INNER JOIN SYSCOLUMNS D ON A.ID = D.ID
WHERE C.indid = D.colid
ORDER BY A.ID, A.PARENT_OBJ, A.XTYPE

+ Recent posts