查询表列
代码
--declare @objid int,@objname char(40)
--set @objname = 'GFM_users';
--select @objid = id from sysobjects where id = object_id(@objname)
--select 'Column_name' = name from syscolumns where id = @objid order by colid
--select c.name from syscolumns c join sysobjects o on c.id = o.id where o.id = object_id('GFM_Users')
select name from syscolumns where id = object_id('GFM_Users')
select name from sysobjects where type='U'
--set @objname = 'GFM_users';
--select @objid = id from sysobjects where id = object_id(@objname)
--select 'Column_name' = name from syscolumns where id = @objid order by colid
--select c.name from syscolumns c join sysobjects o on c.id = o.id where o.id = object_id('GFM_Users')
select name from syscolumns where id = object_id('GFM_Users')
select name from sysobjects where type='U'