Author: Land island Studio
Sometimes you need to check whether the SQL Server version is good. The following code is collected from the Internet. The test passed in Delphi.
-- SQL Server 2000
Select serverproperty ('productversion'), serverproperty ('productlevel'), serverproperty ('version ')
-- SQL Server 2005
Select serverproperty ('productversion'), serverproperty ('productlevel'), serverproperty ('version ')
The returned result is as follows:
8.00.194/RTM/Developer Edition
In Delphi, the code needs to be processed. It should be written in this way. Otherwise, the return value cannot be displayed as a character.
Sqlgetsqlserveredtion = 'select rtrim (convert (char (50), serverproperty (''productversion''), '+
'Rtrim (convert (char (50), serverproperty (''productlevel''), '+
'Rtrim (convert (char (50), serverproperty ('version '')))';