Tuesday, March 20, 2012

backup db

I'm trying to make a backup of a DB with a stored procedure. I call the sp
through an ODBC connection.When the backup is placed on a fixed disk
everything is OK. When a give a removable device as target the backup is
removed at the moment the odbc connection is closed. I need the backup on a
removable device.
How can I fix this?
an option is to make the backup on disk and copy it to the removable device,
but I don't know exactly when the backup is finished. can I add something in
the stored procedure to wait for the completion of the backup.
here is the sp:
CREATE PROCEDURE [dbo].[sp_Backup_DB]
@.path varchar (100)
AS
-- Back up the database.
BACKUP DATABASE PasV2 TO DISK = @.path
GOBert
I'm not sure undestand what are you after, however ,see in the BOL WAITFOR
command
"Bert Okkerse" <bizix@.skynet.be> wrote in message
news:uwpRa$LpGHA.148@.TK2MSFTNGP04.phx.gbl...
> I'm trying to make a backup of a DB with a stored procedure. I call the sp
> through an ODBC connection.When the backup is placed on a fixed disk
> everything is OK. When a give a removable device as target the backup is
> removed at the moment the odbc connection is closed. I need the backup on
> a removable device.
> How can I fix this?
> an option is to make the backup on disk and copy it to the removable
> device, but I don't know exactly when the backup is finished. can I add
> something in the stored procedure to wait for the completion of the
> backup.
> here is the sp:
> CREATE PROCEDURE [dbo].[sp_Backup_DB]
> @.path varchar (100)
> AS
> -- Back up the database.
> BACKUP DATABASE PasV2 TO DISK = @.path
> GO
>|||Hi,
If you want to make a copy of your database on removable media try
sp_create_removable
refer BOL for more info
Amol Lembhe
MCDBA
amol.lembhe@.patni.com
"Bert Okkerse" wrote:

> I'm trying to make a backup of a DB with a stored procedure. I call the sp
> through an ODBC connection.When the backup is placed on a fixed disk
> everything is OK. When a give a removable device as target the backup is
> removed at the moment the odbc connection is closed. I need the backup on
a
> removable device.
> How can I fix this?
> an option is to make the backup on disk and copy it to the removable devic
e,
> but I don't know exactly when the backup is finished. can I add something
in
> the stored procedure to wait for the completion of the backup.
> here is the sp:
> CREATE PROCEDURE [dbo].[sp_Backup_DB]
> @.path varchar (100)
> AS
> -- Back up the database.
> BACKUP DATABASE PasV2 TO DISK = @.path
> GO
>
>

No comments:

Post a Comment