possible to backup db from ADP file?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

if it is possible, how would i go about creating routines (storedprocedures?)
that can be invoked from a microsoft access ADP file that will backup (and
hopefully have the ability to also restore) a SQL Server database?

thanks for any and all help!
ben

this is a repeat post from sql.sqlprogramming
 
Hi, Ben.
how would i go about creating routines (storedprocedures?)
that can be invoked from a microsoft access ADP file that will backup (and
hopefully have the ability to also restore) a SQL Server database?

Yes. One may create stored procedures that back up the database and restore
it. Check the BOL for full syntax and various options. OSQL is also
available for maintaining the MSDE.

If you don't have the BOL, you may download it from this Web page:

http://www.microsoft.com/downloads/...b1-a420-445f-8a4b-bd77a7da194b&DisplayLang=en

For example, from BOL:

To back up the database and transaction log file:

-- Note: Creating a logical backup device needs to be done only once.

-- Create the backup device for the full MyNwind backup.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwind_2',
'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\MyNwind_2.dat'

--Create the log backup device.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwindLog1',
'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\MyNwindLog1.dat'

-- Back up the full MyNwind database.
BACKUP DATABASE MyNwind TO MyNwind_2

-- Update activity has occurred since the full database backup.

-- Back up the log of the MyNwind database.
BACKUP LOG MyNwind
TO MyNwindLog1

To restore the database:

-- Note: This example restores a full database backup.

RESTORE DATABASE MyNwind
FROM MyNwind_1

To restore the transaction log:

USE master
GO

RESTORE DATABASE pubs
FROM Pubs1
WITH FILE = 3, NORECOVERY
GO
RESTORE LOG pubs
FROM Pubs1
WITH FILE = 4,
STOPATMARK = 'RoyaltyUpdate'

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
Back
Top