SELECT a.name,b.colid,b.name,c.name,b.usertype,b.length,
CASE WHEN b.status=0 THEN 'NOT NULL'
WHEN b.status=8 THEN 'NULL'
END status,
d.text
FROM sysobjects a,syscolumns b,systypes c,syscomments d
WHERE a.id=b.id AND b.usertype=c.usertype AND a.type='U' --AND a.name='t_user'
AND b.cdefault*=d.id
ORDER BY a.name,b.colid
CASE WHEN b.status=0 THEN 'NOT NULL'
WHEN b.status=8 THEN 'NULL'
END status,
d.text
FROM sysobjects a,syscolumns b,systypes c,syscomments d
WHERE a.id=b.id AND b.usertype=c.usertype AND a.type='U' --AND a.name='t_user'
AND b.cdefault*=d.id
ORDER BY a.name,b.colid