You don't really need to. Just create a Command object with the
appropriate syntax and execute it.
To start with you need to create (for the first time only) a "backup
device". The following (excerpted from Books Online) creates a backup
device called "MyNwind_1" on a "disk" (it could be tape) on the C: drive
at the given path. It can be anywhere. Use the following commands as a
single string in the CommandText.
-- Create a logical backup device for the full MyNwind backup.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwind_1',
DISK ='c:\Program Files\Microsoft SQL
Server\MSSQL\BACKUP\MyNwind_1.dat'Next, backup the database. This is the
string you execute whenever you want to backup the data. No, you don't
have to create the dump device each time.
-- Back up the full MyNwind database.
BACKUP DATABASE MyNwind TO MyNwind_1
hth
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no
rights.