How can I do the following with C#:
- Completely backup an existing database.
- Partially backup an existing database.
- Completely restore an existing database from a backup file.
- Partially restore an existing database from a backup file.
My database saves images on the HARDDISK sometimes I need to backup and restore the database without the stored Images (might be 50 GB).
I need partially backup that execluding the FILESTREAM data
(The saved files should be not included in the backup file).
I need partially restore that retrive the database without FILESTREAM data (The stored files should be not restored).
What is the best practices to do that?
Best Answer
Remmber you need the following assemblies:
Microsoft.SqlServer.ConnectionInfo
Microsoft.SqlServer.Management.Sdk.Sfc
Microsoft.SqlServer.Smo
Microsoft.SqlServer.SmoExtended
More info http://technet.microsoft.com/de-de/library/microsoft.sqlserver.management.smo.aspx