i have database on computer 1 (sql server 2008)
and i have sql server 2008 on computer 2
i need any sample code in C# that i can backup database on computer 1
to computer 2
thank’s in advance
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can execute a query on the DB such as this:
Note you can get the code by going into your SQL Server Management studio, get to the backup menu for the database you want to restore, set it up and just before you click OK, look on the top of the menu and you will see a Script button. Click it, it will generate an SQL script to do the behavior you want.