array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'es', ), 'this' => array ( 0 => 'function.sqlsrv-server-info.php', 1 => 'sqlsrv_server_info', ), 'up' => array ( 0 => 'ref.sqlsrv.php', 1 => 'SQLSRV Funciones', ), 'prev' => array ( 0 => 'function.sqlsrv-send-stream-data.php', 1 => 'sqlsrv_send_stream_data', ), 'next' => array ( 0 => 'refs.calendar.php', 1 => 'Extensiones relacionadas con fecha y hora', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/sqlsrv/functions/sqlsrv-server-info.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(No version information available, might only be in Git)
sqlsrv_server_info — Returns information about the server
conn
The connection resource that connects the client and the server.
Returns an array as described in the following table:
CurrentDatabase | The connected-to database. |
---|---|
SQLServerVersion | The SQL Server version. |
SQLServerName | The name of the server. |
Ejemplo #1 sqlsrv_server_info() example
<?php
$serverName = "serverName\sqlexpress";
$conn = sqlsrv_connect( $serverName);
if( $conn === false ) {
die( print_r( sqlsrv_errors(), true));
}
$server_info = sqlsrv_server_info( $conn);
if( $server_info )
{
foreach( $server_info as $key => $value) {
echo $key.": ".$value."<br />";
}
} else {
die( print_r( sqlsrv_errors(), true));
}
?>