Last Updated: 20/4/2003
To use SQLDMO from .NET add a project reference for the 'Microsoft SQLDMO Object Library' COM component.
Getting a list of SQL Servers |
Getting a list of SQL Servers is one of the
few tasks that doesn't require you to log-in first:
|
Connecting / Disconnecting with SQLDMO |
As with SQL data access, we have to
authenticate ourselves to SQL before we can use the majority of the
Management Objects API functionality.
Disconnection is simple, but it is worth nothing the unusual casing of the DisConnect:
|
Restoring a Database |
Connect to the server as shown above to obtain a SQLDMO.SQLServer object, then:
|
Backing up a Datbase |
Connect to the server as shown above to obtain a SQLDMO.SQLServer object, then:
|