--
查询非系统数据库
Select
name
FROM
Master.. SysDatabases
where
dbid
>
4
--
选择assc数据库下的所有表
use
[
assc
]
SELECT
name
FROM
sysobjects
WHERE
xtype
=
'
U
'
Or
xtype
=
'
S
'
--
选择assc数据库下的所有用户表
use
[
assc
]
SELECT
name
FROM
sysobjects
WHERE
xtype
=
'
U
'
AND
OBJECTPROPERTY
(id,
'
IsMSShipped
'
)
=
0
--
查询water数据库下的admin表的字段名,长度,类型,字段说明
use [assc] SELECT a.[name] as '字段名',a.length '长度',c.[name] '类型' FROM syscolumns a
left join systypes b on a.xusertype=b.xusertype
left join systypes c on a.xtype = c.xusertype
inner join sysobjects d on a.id=d.id
where d.name='bd_admin'
posted on 2009-11-03 17:55
影子 阅读(85)
评论(0) 编辑 收藏 所属分类:
asp.net点滴