Using SMO to restore a database snapshot
-
Freitag, 3. Februar 2012 17:49
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
Alle Antworten
-
Montag, 6. Februar 2012 04:55Moderator
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
-
Donnerstag, 17. Mai 2012 10:48
Hope this may help you, please check it out.
http://www.bigresource.com/MS_SQL-Backup-of-mirrored-databases-using-TSM-2Qp3IjJu.html
-
Donnerstag, 1. November 2012 22:39Moderator
Please report this issue to https://connect.microsoft.com/SQLServer/Feedback
Thanks
Sethu Srinivasan [MSFT]
SQL Server

