查询 SQL SERVER 的版本号
作者:陆岛工作室
有时会需要查询一下SQL SERVER 的版本好, 以下代码从网上收集而来。 在DELPHI 下测试通过。
--SQL SERVER 2000
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
--SQL SERVER 2005
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
返回如下:
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
8.00.194 / RTM / Developer Edition
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
在 DELPHI 下,代码需要作一下处理。应该是这样写才对,不然返回值不能显示为字符
sqlGetSQLServerEdtion = 'SELECT RTRIM(CONVERT(char(50), SERVERPROPERTY(''productversion''))),'+
'RTRIM(CONVERT(char(50), SERVERPROPERTY (''productlevel''))),' +
'RTRIM(CONVERT(char(50), SERVERPROPERTY (''edition'')))';
有时会需要查询一下SQL SERVER 的版本好, 以下代码从网上收集而来。 在DELPHI 下测试通过。
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
在 DELPHI 下,代码需要作一下处理。应该是这样写才对,不然返回值不能显示为字符
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
作者: 陆岛工作室