/*表清單*/
SELECT
B.name AS username,
A.name,
A.id,
A.deltrig,
A.instrig,
A.updtrig,
A.seltrig
FROM sysobjects AS A,
sysusers AS B
WHERE A.uid=B.uid
AND A.type='U'
ORDER BY username, A.name
/*字段
status字段為位圖,各位含義:
0x08 = 列允許空值。
0x10 = 當添加 varchar 或 varbinary 列時,ANSI 填充生效。保留 varchar 列的尾隨空格,保留 varbinary 列的尾隨零。
0x40 = 參數為 OUTPUT 參數。
0x80 = 列為標識列。
*/
SELECT
A.colid,
A.name,
A.xusertype,
A.typename,
A.length,
A.xprec,
A.xscale,
(A.status & 0x08) AS is_null,
(A.status & 0x10) AS ansi_fill,
(A.status & 0x40) AS for_ouput,
(A.status & 0x80) AS is_identify,
B.text AS default_text
FROM (SELECT
Y.colid,
Y.name,
Y.xusertype,
Z.name AS typename,