在线咨询
QQ咨询
服务热线
服务热线:13125520620
TOP

获取所有用户表及根据表Id取得表字段信息-数据库

发布时间:2011-11-12 浏览:5032

SQL SERVER 2000

sql_pub = "select id, [name], crdate from sysobjects d where  d.xtype = 'U' and  d.name <> 'dtproperties' order by a.[name] asc"

 sql_pub = " SELECT " & _
  "      a.[name] as '字段名称'" & _
  "    , (case when COLUMNPROPERTY( a.id,a.name,'IsIdentity')=1 then '√'else '' end) as 标识" & _
  "    , b.name 类型" & _
  "    , a.length 占用字节数" & _
  " , (case when a.isnullable = 1 then '√'else '' end) 允许空" & _
  " , isnull(e.text,'') 默认值" & _
  " , cast(isnull(g.[value],'') as varchar(100)) AS 字段说明" & _
  " FROM syscolumns  a" & _
  " left join systypes b" & _
  " on  a.xtype = b.xusertype" & _
  " left join syscomments e" & _
  " on a.cdefault=e.id" & _
  " left join sysproperties g" & _
  " on a.id = g.id AND a.colid = g.smallid" & _
  " where a.id = " & table_id & _
  " order by a.colorder"

TAG
软件定制,软件开发,瀚森HANSEN,辽宁,沈阳,抚顺
0
该内容对我有帮助