MS Sql常用SQL语句
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')