数据库特例操作,

//查询所有用户表

select [name], [id] from sysobjects where [type] = 'U';

//查询所有系统表

select [name], [id] from sysobjects where [type] = 'S';

//列出数据表中的所有字段

select * from syscolumns where ID = OBJECT_ID('S_CityList');

//查询所有用户表中的非重复字段

select distinct [name] from syscolumns

where ID in (select id from sysobjects where [type] = 'U');

你可能感兴趣的:(数据库)