用SQL语句如何查看表结构,如何得到sp_helpuser返回 的结果

用SQL语句如何查看表结构,如何得到sp_helpuser返回 的结果
---------------------------------------------------------------

1.
select t1.tablename,t1.colname,descr=isnull(t2.value,''),t1.type,t1.length,t1.isnullable from
(select a.id,tablename=d.name,colname=a.name ,colid=a.colid,type=b.name ,a.length, a.isnullable from syscolumns a, systypes b,sysobjects d where a.xtype=b.xusertype and a.id=d.id and d.xtype='U' )t1 left join sysproperties t2 on t1.id=t2.id and t1.colid=t2.smallid
2.
create table #temp(username sysname,groupname sysname,loginname sysname,defdbname sysname,userid int,sid varbinary)
insert #temp exec sp_helpuser
select * from #temp
drop table #temp
---------------------------------------------------------------

sp_columns

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus