Chapter 7. Performing Common Database Tasks Using SQL-DMO

In this chapter you will

Regardless of the language you are now using for creating your database applications, if you are using SQL Server for your database, you still need to be able to perform basic database tasks on your back-end database. In addition, you will probably want to give your users the ability to perform these tasks without having to use Enterprise Manager.

The way to allow the users to perform some of the common database tasks such as backing up and restoring the database is to take advantage of SQL-Distributed Management Objects (SQL-DMO) and Data Transformation Services (DTS). When you use the Backup/Restore Wizard (see Figure 7.1) in the Enterprise Manager, you are really using SQL-DMO, with the interface created for you.

Figure 7.1. Under the covers, the SQL-DMO objects are being used to perform the requested tasks such as backup.

graphics/07fig01.gif

The same also can be said of the DTS object model, used to create transformation packages and other services (see Figure 7.2.)

Figure 7.2. As with SQL-DMO and backing up databases, when exporting data, SQL-DTS objects are used.

graphics/07fig02.jpg

As this chapter describes each of the tasks that you will be able to accomplish, you will see more of the various objects, properties, and methods that you can use to accomplish your tasks.