得到所有的数据表(用户数据表):
select * from sysobjects where xtype = 'u'
得到当前数据表的所有字段:
select * from syscolumns where id = object_id('数据表名')
select * from sysobjects where xtype = 'u'
得到当前数据表的所有字段:
select * from syscolumns where id = object_id('数据表名')
就use northwind
有关列的在表SysColumns中存放。
select * from sysobjects;
use northwind
select name as 表名 from sysobjects where xtype = 'u'
use northwind
select name as 表名 from sysobjects
where xtype = 'u' or xtype='s'
use northwind
select name as 表名 from sysobjects
where xtype = 'u' or xtype='s'