Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do a MS SQL Backup 1

Status
Not open for further replies.

pdotd

Programmer
Jun 15, 2004
29
CA
i just started programming in C#
and i am curious how to do a complete backup in MS SQL using C#


pdotd
 
You can call a system stored procedure sp_start_job and pass a name of a backup job.
Here is T-SQL statment that you can execute from Query analyzer:
exec msdb.dbo.sp_start_job @job_name = 'Your backup job name'
Create a backup job and then pass a name of a store procedure as msdb.dbo.sp_start_job, then pass a parametar @job_name with name of backup job and execute scalar. You can do the same with bcp command but I think previous is better.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top