4

How to create SQL Server 2008 database full backup programmatically in desired folder with using Microsoft visual studio 2010 c#

2

1 Answer 1

6

Just execute SQL Server command

 BACKUP DATABASE database_name TO DISK='d:\path\to\backup\file\on\the\server.bak'
Sign up to request clarification or add additional context in comments.

6 Comments

And just remember that you can only backup to drives attached to your SQL Server machine (including UNC paths); you cannot back from a server to a local drive on your PC
so it is this much easy. i will try now :)
ok i tried and it works great. but 2 questions. can there be any timeout problem because my database is really big ? also is this same with ms sql server management studio right click desired database tasks backup full ?
1) probably yes; and 2) yes, created backup has exactly the same format.
Hi, does this command also work with SQL Server 2005? Must either SQL Server 2005/2008 have to have any particular components installed (e.g. SMO components)? Thanks
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.