Partager via


Application.GetServerInfo Method

Returns the SQL Server version number of the SQL Server product installed on the target server.

Espace de noms: Microsoft.SqlServer.Dts.Runtime
Assembly: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

Syntaxe

'Déclaration
Public Sub GetServerInfo ( _
    server As String, _
    <OutAttribute> ByRef serverVersion As String _
)
public void GetServerInfo (
    string server,
    out string serverVersion
)
public:
void GetServerInfo (
    String^ server, 
    [OutAttribute] String^% serverVersion
)
public void GetServerInfo (
    String server, 
    /** @attribute OutAttribute() */ /** @ref */ String serverVersion
)
JScript ne prend pas en charge le passage d'arguments de type valeur par référence.

Paramètres

  • server
    The name of the server hardware to check for the SQL Server product version.
  • serverVersion
    The version number of the SQL Server product, defined as an out parameter.

Notes

The default value of this property is 9.

Exemple

The following example retrieves the SQL Server version number from the specified server.

static void Main(string[] args)
        {
            Application app = new Application();
            String outParam;
            app.GetServerInfo("yourserver", out outParam);
            Console.WriteLine("Server version? " + outParam);
        }
Sub Main(ByVal args() As String)
    Dim app As Application =  New Application() 
    Dim outParam As String
    app.GetServerInfo("yourserver", out outParam)
    Console.WriteLine("Server version? " + outParam)
End Sub

Sample Output:

Server version? 9.00.926.00

Sécurité des threads

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Plateformes

Plateformes de développement

Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.

Plateformes cibles

Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.

Voir aussi

Référence

Application Class
Application Members
Microsoft.SqlServer.Dts.Runtime Namespace