FULL JOIN (SELECT
TABLENAME = B.NAME,
FIELDNAME = A.NAME,
FIELDSNO = A.COLID,
FIELDTYPE = C.NAME,
LENGTH = A.LENGTH,
LENSEC = A.XSCALE,
ALLOWNULL = A.ISNULLABLE
FROM INTFSIMS..SYSCOLUMNS A
LEFT JOIN INTFSIMS..SYSOBJECTS B
ON A.ID = B.ID
LEFT JOIN INTFSIMS..SYSTYPES C
ON A.XUSERTYPE = C.XUSERTYPE
WHERE B.XTYPE = 'U') B
ON A.TABLENAME = B.TABLENAME
AND A.FIELDNAME = B.FIELDNAME