You are here

public function DatabaseSchema_sqlsrv::EngineVersion in Drupal driver for SQL Server and SQL Azure 7.2

Same name and namespace in other branches
  1. 7.3 sqlsrv/schema.inc \DatabaseSchema_sqlsrv::EngineVersion()
  2. 7 sqlsrv/schema.inc \DatabaseSchema_sqlsrv::EngineVersion()

Retrieve Engine Version information.

1 call to DatabaseSchema_sqlsrv::EngineVersion()
DatabaseSchema_sqlsrv::EngineVersionNumber in sqlsrv/schema.inc
Retrieve Major Engine Version Number as integer.

File

sqlsrv/schema.inc, line 437
Database schema code for Microsoft SQL Server database servers.

Class

DatabaseSchema_sqlsrv

Code

public function EngineVersion() {
  if ($cache = fastcache::cache_get('EngineVersion', 'schema')) {
    return $cache->data;
  }
  $version = $this->connection
    ->query_direct(<<<EOF
    SELECT CONVERT (varchar,SERVERPROPERTY('productversion')) AS VERSION,
    CONVERT (varchar,SERVERPROPERTY('productlevel')) AS LEVEL,
    CONVERT (varchar,SERVERPROPERTY('edition')) AS EDITION
EOF
)
    ->fetchAssoc();
  fastcache::cache_set('EngineVersion', $version, 'schema');
  return $version;
}