This Microsoft® Visual Basic® sample demonstrates how to use the Data Transformation Services (DTS) TransferObjectsTask object to copy a database. This sample copies all objects except dependencies, logins, and users from one named database on the local server to another named database on the local server. If you wish to include dependencies, logins, or users in the transfer, set the IncludeDependencies, IncludeLogins, and IncludeUsers properties to TRUE.
C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Samples\Dts\Dtstasks\DTSCopyDatabase
This sample assumes that you have created the pubs2 database with no data in it.