MS Sql常用SQL语句
时间:2011-05-20 来源:红星拖拉机
1、查询数据库某张表总的列数:
select count(name)as colNum from syscolumns where id=(select id from sysobjects where xtype='u' and name='tableName')
2、查询数据库某张表总的数据行数:
select count(*) rowCount FROM tableName
3、获取数据库某张表所有列的名称:
select name from syscolumns where ID=OBJECT_ID('tableName')
相关阅读 更多 +
排行榜 更多 +