Thursday, February 9, 2012

attach/deattach database

is it possible to create a dts job or sproc that can be launched via a vbs
file or wsh script that:
1. unattaches a sql 2000 database
2. copies it to a removable drive
3. re-attaches original db
4. and does opposite at office to keep a sql in sync?
any ideas on best method and syntax would be appreciated.Scott,
If youo are trying to have a remote database that is in sync, or at least
is in syn some what, is it possible to use replication? A snap shot
replication using the SQL Server as both the publisher and the distributor
can create a push a snapshot of the entire database, or selected tables from
the database. If the databases are not connected (I noted that you want to
use a removeable drive) then a process can be developed to copy the files to
a drive and then mount the databases on the remote server. Here is just one
method:
1. Create a job that backups up the database
2. Create a DTS package that will copy the backup files to the removable
drive.
3. Step 2 of the job would be to execute the DTS package in step 2.
4. Do the reverse on the remote server but in place of the backup create a
job that restores the database.
Detaching and reattaching can be an option as well as long are not
connections to the database when it is detached. A Backup can be done
regardless if the database is in use or not.
Hope this helps.
Rick
"scott" wrote:
> is it possible to create a dts job or sproc that can be launched via a vbs
> file or wsh script that:
> 1. unattaches a sql 2000 database
> 2. copies it to a removable drive
> 3. re-attaches original db
> 4. and does opposite at office to keep a sql in sync?
> any ideas on best method and syntax would be appreciated.
>
>

No comments:

Post a Comment