Backing Up a SQL Server Database Directly Onto a Remote Server

The below statement tells the SQL Server that once the backup of first database is complete proceed with the second and so on. This procedure continues until we have reached the last database present in the sysdatabases table in the master database.

FETCH NEXT FROM DATABASE_BACKUP INTO @Name
END

The next statement tells the SQL Server to release the row set.

CLOSE DATABASE_BACKUP

The below statement releases the resources asociated with the cursor.

DEALLOCATE DATABASE_BACKUP

If there are any suggestions for improvement please leave a comment or contact me directly at singhsatnam84@yahoo.com.

Pages: 1 2




Related Articles :

36 Responses to “Backing Up a SQL Server Database Directly Onto a Remote Server”

  1. which domain account do we need to give access to

  2. Nicely written code… Keep up with the good work

  3. add try catch to the script so that if one of the backups fails it continues with the rest.

  4. Very nice post. I just stumbled upon your blog and wished to say that I have really enjoyed surfing around your blog posts. In any case I will be subscribing to your rss feed and I hope you write again soon!

  5. It’s spokoy how clever some ppl are. Thanks!

  6. I’m impressed. You’ve really rasied the bar with that.

  7. Thanks for sharing, I was looking exactly for the same.

  8. Nice code. You can do the same with a maintenance plan and specify the databases to back up.

  9. There is one thing to worry about here.
    Should there be a network hiccup, the backup to a UNC path will fail. SQL’s backup doesn’t recover from Network timeouts at all.

    • This is especially true for large databases, like ours, which takes over an hour to backup. The backup will actually be corrupt sometimes. Sometimes it will report as a failure, but actually work. Our backups fail three or four times weekly over a UNC path. And the two servers involved are nodes on the same cluster.

  10. Looks good – thanks for sharing. It may be possible to skip the cursor and use some sort of WHILE looping instead.

  11. Actually interesting content articles. I enjoyed reading through it.

  12. Hi there, You have performed a great job. I will certainly digg it and personally suggest to my friends. I’m sure they’ll be benefited from this site.

  13. Really good Satnam!!!

  14. Many thanks for an incredible publish, would read your others content. many thanks for your thoughts on this, I felt a lttle bit struck by this article. Thanks again! You earn an excellent moment. Displays the beauty through wonderful info here. I believe if a greater number consideration for it that way, they’d have a better time period obtain the suspend ofing the matter.

  15. Hey There. I found your blog using msn. This is an extremely well written article. I’ll be sure to bookmark it and come back to read more of 301 Moved Permanently . Thanks for the post. I’ll certainly comeback.

  16. Wow, marvelous blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your website is great, let alone the content!. Thanks For Your article about 301 Moved Permanently .

  17. Hey There. I found your blog using msn. This is a really well written article. I’ll be sure to bookmark it and come back to read more of 301 Moved Permanently . Thanks for the post. I will certainly comeback.

  18. Very nice post. I just stumbled upon your weblog and wished to say that I have really enjoyed surfing around your blog posts. After all I will be subscribing to your rss feed and I hope you write again very soon!

  19. Oh my goodness! an amazing article dude. Thank you However I am experiencing issue with ur rss . Don’t know why Unable to subscribe to it. Is there anyone getting identical rss problem? Anyone who knows kindly respond. Thanks

  20. Thank you an unbelievable put up, may read your particular others topics. thanks for your thinking for this, I experienced a trifle strike by this short article. Many thanks again! You wanna make an excellent moment. Displays the beauty through excellent info here. I feel that in case more people considered it like that, they’d have got a better moment in time receive the grasp ofing the difficulty.

  21. The best this about electric toothbrush is that it is rechargeable.

  22. Quite Nicely done, effectively written in simple steps.. really really appreciate the effort put in..Thanks Mr. Satnam Singh.

  23. Thanks for an amazing publish, can examine your particular others content. thank you your ideas for this, I felt a bit made an impact to by this short article. Merit again! You wanna make a good time. Has great report here. I believe that in case a greater number of people thought about it like that, they’d have a very better time frame receive the grasp ofing the issue.

  24. I’m grateful you made the post. It’s cleerad the air for me.

  25. Fell out of bed feeling down. This has brighetend my day!

Trackbacks/Pingbacks

  1. alice johnson - February 22, 2012

    bob haircuts

    Hi there, just became aware of your blog through Google, and found that it’s really informative. I am gonna watch out for brussels. I’ll appreciate if you continue this in future. Lots of people will be benefited from your writing. Cheers!…

Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |