All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
获取所有用户表及根据表Id取得表字段信息_[SQL,Server教程]

Writer: 归海一刀 Article type: Programming skills(编程技巧) Time: 2014/2/1 0:23:32 Browse times: 469 Comment times: 0

获取所有用户表及根据表Id取得表字段信息_[SQL,Server教程]


Head photo

Go homepage
Upload pictures
Write articles

获取所有用户表及根据表Id取得表字段信息_[SQL Server教程] 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"

来源:CSDN




There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.