InstAPI.GetSQLServerByID Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieves the server name of a SQL instance by the given instance ID and host name.
Overloads
GetSQLServerByID(String, INST_ID, StringBuilder, UInt32) |
Obsolete.
Retrieves the server name of a SQL instance by the given instance ID and host name. |
GetSQLServerByID(String, INST_ID) |
Retrieves the server name of a SQL instance by the given instance ID and host name. |
GetSQLServerByID(String, INST_ID, StringBuilder, UInt32)
Caution
This overload is obsolete; use GetSQLServerByID(hostName, instanceID), instead.
Retrieves the server name of a SQL instance by the given instance ID and host name.
public:
static bool GetSQLServerByID(System::String ^ hostName, Microsoft::SqlServer::INST_ID ^ instanceID, System::Text::StringBuilder ^ sqlServerName, System::UInt32 % bufferSize);
[System.Obsolete("This overload is obsolete; use GetSQLServerByID(hostName, instanceID), instead.")]
public static bool GetSQLServerByID (string hostName, Microsoft.SqlServer.INST_ID instanceID, System.Text.StringBuilder sqlServerName, ref uint bufferSize);
[<System.Obsolete("This overload is obsolete; use GetSQLServerByID(hostName, instanceID), instead.")>]
static member GetSQLServerByID : string * Microsoft.SqlServer.INST_ID * System.Text.StringBuilder * uint32 -> bool
Public Shared Function GetSQLServerByID (hostName As String, instanceID As INST_ID, sqlServerName As StringBuilder, ByRef bufferSize As UInteger) As Boolean
Parameters
- hostName
- String
A pointer to the server's host name.
- instanceID
- INST_ID
A pointer to the instance ID of the relevant instance.
- sqlServerName
- StringBuilder
A pointer to a buffer to receive the SQL server name.
- bufferSize
- UInt32
A pointer to a DWORD value to supply the length of the buffer. Returns the required length if the supplied buffer is too small.
Returns
true
if the call succeeded; otherwise, false
.
- Attributes
Applies to
GetSQLServerByID(String, INST_ID)
Retrieves the server name of a SQL instance by the given instance ID and host name.
public:
static System::String ^ GetSQLServerByID(System::String ^ hostName, Microsoft::SqlServer::INST_ID ^ instanceID);
public static string GetSQLServerByID (string hostName, Microsoft.SqlServer.INST_ID instanceID);
static member GetSQLServerByID : string * Microsoft.SqlServer.INST_ID -> string
Public Shared Function GetSQLServerByID (hostName As String, instanceID As INST_ID) As String
Parameters
- hostName
- String
A pointer to the server's host name.
- instanceID
- INST_ID
A pointer to the instance ID of the relevant instance.
Returns
The server name of a SQL instance by the given instance ID and host name.