Application.GetServerInfo Method

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

命名空间: Microsoft.SqlServer.Dts.Runtime
程序集: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

语法

声明
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 不支持由引用传递值类型参数。

参数

  • 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.

备注

The default value of this property is 9.

示例

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

线程安全

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.

平台

开发平台

有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。

目标平台

有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。

请参阅

参考

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