You can backup a database by sending T-SQL commands [1], i.e:
-- Create a logical backup device for the full MyNwind backup.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwind_1', 'c:\Program Files\Microsoft
SQL Server\MSSQL\BACKUP\MyNwind_1.dat'
-- Back up the full MyNwind database.
BACKUP DATABASE MyNwind TO MyNwind_1
You could execute the above with a SqlConnection and a ExecuteNonQuery
on SqlCommand.
Once the devices are setup, a login need only be in the
db_backupoperator role to use BACKUP. The diskadmin role is needed for
sp_adddumpdevice.
[1]
http://msdn.microsoft.com/library/de...ba-bz_35ww.asp
HTH,
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Thu, 21 Jul 2005 14:02:03 -0700, "Ed"
<Ed@discussions.microsoft.com> wrote:
I have a MS SQL database process that is run from ASP.NET.
I would like to be able to backup the SQL database using either
a full database or transaction log backup immediately before the
backup is done. Is this possible with ASP.NET and
what kind of permissions or role would the connection SQL connection account
need to perfom the backup. I would like to give the account the minimum
permissions needed.