SELECT
NAME
FROM
MASTER.DBO.SYSDATABASES
ORDER
BY
NAME
SELECT
NAME
FROM
SYSOBJECTS
WHERE
XTYPE=
'U'
ORDER
BY
NAME
SELECT
NAME
FROM
SYSOBJECTS
WHERE
TYPE =
'U'
AND
SYSSTAT =
'83'
SELECT
NAME
FROM
SYSCOLUMNS
WHERE
ID=OBJECT_ID(
'BCUSTOMER'
);
SELECT
SYSCOLUMNS.
NAME
,SYSTYPES.
NAME
,SYSCOLUMNS.ISNULLABLE,SYSCOLUMNS.LENGTHFROM SYSCOLUMNS, SYSTYPES
WHERE
SYSCOLUMNS.XUSERTYPE = SYSTYPES.XUSERTYPE
AND
SYSCOLUMNS.ID = OBJECT_ID(
'BCUSTOMER'
);
SELECT
SYSCOLUMNS.
NAME
,SYSOBJECTS.XTYPE
FROM
SYSCOLUMNS,SYSOBJECTS,SYSINDEXES,SYSINDEXKEYS
WHERE
SYSCOLUMNS.ID = OBJECT_ID(
'BCUSTOMER'
)
AND
SYSOBJECTS.XTYPE =
'PK'
AND
SYSOBJECTS.PARENT_OBJ = SYSCOLUMNS.ID
AND
SYSINDEXES.ID = SYSCOLUMNS.ID
AND
SYSOBJECTS.
NAME
= SYSINDEXES.
NAME
AND
SYSINDEXKEYS.ID = SYSCOLUMNS.ID
AND
SYSINDEXKEYS.INDID = SYSINDEXES.INDID
AND
SYSCOLUMNS.COLID = SYSINDEXKEYS.COLID;
'表示没有找到'
SELECT
A.
NAME
,G.VALUE
FROM
SYSCOLUMNS
AS
A
LEFT
JOIN
SYSPROPERTIES G
ON
A.ID=G.ID
AND
A.COLID = G.SMALLID
WHERE
A.ID=
'BCUSTOMER'