常用SQL查询
时间:2007-04-19 来源:ptcaddy
--得到一个数据表的字段名.字段类型.长度
Select Syscolumns.Name ColName,Systypes.Name TypeName,Syscolumns.length From Syscolumns
Join Systypes on Syscolumns.xtype=Systypes.xtype
Where Syscolumns.Id=Object_Id('Category') --得到列名 select name
from Syscolumns
where Syscolumns.Id=Object_Id('table') --得到用户数据表名 select name
from dbo.sysobjects
where xtype='u'
Join Systypes on Syscolumns.xtype=Systypes.xtype
Where Syscolumns.Id=Object_Id('Category') --得到列名 select name
from Syscolumns
where Syscolumns.Id=Object_Id('table') --得到用户数据表名 select name
from dbo.sysobjects
where xtype='u'
相关阅读 更多 +