Using SMO to restore a database snapshot
-
Friday, February 03, 2012 5:49 PM
Hey folks,
I would like to restore a database snapshot using SMO API calls, rather than using Transact-SQL (restore database <dbname> from database_snapshot = '<SnapshotName>') to do so. I've been searching through the Microsoft.SqlServer.Smo assembly without a whole lot of luck though. It doesn't appear that there is a Database.Restore('snapshotname') method, or anything like it.
Any ideas?
Cheers,
TrevorIf this post was helpful, please click the little "Vote as Helpful" button :)
Trevor Sullivan
Trevor Sullivan's Tech Room
Twitter Profile
All Replies
-
Monday, February 06, 2012 4:55 AMModerator
Hi Trevor,
TechNet Subscriber Support
It seems there is not a method in SMO which can be used to restore the database snapshot directly. Issue the Transact-SQL command is a simple way to do this. You may have a look at the Volume Shadow Copy Service API about this type of usage: Introduction to the Volume Shadow Copy Service API in C++.
If you are TechNet Subscription user and have any feedback on our support quality, please send your feedback here.Stephanie Lv
TechNet Community Support
-
Thursday, May 17, 2012 10:48 AM
Hope this may help you, please check it out.
http://www.bigresource.com/MS_SQL-Backup-of-mirrored-databases-using-TSM-2Qp3IjJu.html
-
Thursday, November 01, 2012 10:39 PMModerator
Please report this issue to https://connect.microsoft.com/SQLServer/Feedback
Thanks
Sethu Srinivasan [MSFT]
SQL Server

