日期:2014-05-19  浏览次数:20387 次

获得数据库类型
通过SQL怎样得到当前的数据库类型(SQL   Server或MySQL等)和版本?

------解决方案--------------------
版本就知道
select @@version
------解决方案--------------------

select serverproperty( 'productversion '),serverproperty( 'productlevel '),serverproperty( 'edition ')


---参见帮助文档:serverproperty
或者 select @@version
------解决方案--------------------
后面得加分号
SELECT @@VERSION;
mysql中返回一般如:5.0.24a-standard-log
sqlserver返回:Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)
Oct 14 2005 00:33:37
Copyright (c) 1988-2005 Microsoft Corporation
Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 4)

------解决方案--------------------
你还是根据ado连接串判断吧