SQL Server与SQL Server Express的区别 https://www.cnblogs.com/jerry01/articles/1614859.html
1.sqlserver 查询所有表的记录数
select a.name as 表名,max(b.rows) as 记录条数 from sysobjects a ,sysindexes b
where a.id=b.id and a.xtype='u'
group by a.name
order by max(b.rows) desc
# 获取记录总数据
SELECT
SUM (记录条数) AS 记录条数
FROM
(
SELECT
a.name AS 表名,
MAX (b. ROWS) AS 记录条数
FROM
sysobjects a,
sysindexes b
WHERE
a.id = b.id
AND a.xtype = 'u'
GROUP BY
a.name
) t
2.查询数据库版本信息
sqlcmd -S 192.168.1.177 -U sa -P Fjtwkfb
1> SELECT @@VERSION
2> go
Microsoft SQL Server 2008 (SP2) - 10.0.4000.0 (Intel X86) # 2008版显示内容
Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) # 2008 R2版显示内容
3.SQLServer版本对应内部数据库版本
SQLServer版本对应内部数据库版本
源答SQL Server版本内 内部数据库版本
SQL Server 2016 852
SQL Server 2014 782
SQL Server 2012 706
SQL Server 2008 R2 665
SQL Server 2008 661
SQL Server 2005 with vardecimal enabled 612
SQL Server 2005 611
SQL Server 2000 539
SQL Server 7 515
查询SQLServer对应的内容部数据库版本号
select DATABASEPROPERTYEX('master','version')