Condividi tramite


Instance.Repair Method (String, String, String, String, String, String)

Repairs the metadata in system databases for the specified instance. Use this method if you are using SQL Server Authentication to access the Motore di database.

Spazio dei nomi: Microsoft.SqlServer.Management.Nmo
Assembly : Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Sintassi

'Dichiarazione
Public Shared Sub Repair ( _
    instanceName As String, _
    databaseName As String, _
    schemaName As String, _
    serverName As String, _
    sqlUserName As String, _
    sqlPassword As String _
)
public static void Repair (
    string instanceName,
    string databaseName,
    string schemaName,
    string serverName,
    string sqlUserName,
    string sqlPassword
)
public:
static void Repair (
    String^ instanceName, 
    String^ databaseName, 
    String^ schemaName, 
    String^ serverName, 
    String^ sqlUserName, 
    String^ sqlPassword
)
public static void Repair (
    String instanceName, 
    String databaseName, 
    String schemaName, 
    String serverName, 
    String sqlUserName, 
    String sqlPassword
)
public static function Repair (
    instanceName : String, 
    databaseName : String, 
    schemaName : String, 
    serverName : String, 
    sqlUserName : String, 
    sqlPassword : String
)

Parametri

  • instanceName
    The name of the instance of Notification Services for which the metadata information needs to be repaired.
  • databaseName
    The name of the instance database. This value is provided in the instance configuration when creating or updating the instance.
  • schemaName
    The name of the database schema for instance data. This value is provided in the instance configuration when creating or updating the instance.
  • serverName
    The name of the Motore di database instance that hosts the instance database.
  • sqlUserName
    The SQL Server login used to connect to SQL Server.

    If you are using SQL Server Authentication to connect to SQL Server, specify a login using this parameter. Also specify a password using the sqlPassword parameter.

    If you are using Windows Authentication do not specify the sqlUsername and sqlPassword parameters

  • sqlPassword
    The password associated with the sqlUserName login.

Osservazioni

When you create an instance of Notification Services, information about the instance is recorded in the msdb database. A public view called msdb.NS90.NSInstances is provided over this table, which is used to discover instances on the server.

If you attach a database that contains instance or application data to a server, such as when you rebuild a server or move an instance of Notification Services, the metadata in msdb does not contain information about the instance. As a result, certain functions of Microsoft SQL Server Management Studio, the nscontrol command-prompt utility, and Notification Services Management Objects (NMO) may not work as expected.

Thread Safety

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.

Piattaforme

Piattaforme di sviluppo

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Piattaforme di destinazione

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Vedere anche

Riferimento

Instance Class
Instance Members
Microsoft.SqlServer.Management.Nmo Namespace

Altre risorse

Comando nscontrol repair