how do i split large SQL database backup files in .net?
I am working on backing up and restoration of SQL Database. I am new to
this.I have an issue related to Backup process. I have SQL database and I
am using BACKUP and RESTORE classes to perform backup and restore of
database. I want to make my program more efficient using split backup. I
have aprx 15 to 20 GB of data. so I want to split my my backup files in
specified limit lets say 8-10 GB. I can do this using below SQL
statements:
BACKUP DATABASE AdventureWorks
TO DISK = 'C:\Backup\MultiFile\AdventureWorks1.bak',
DISK = 'C:\Backup\MultiFile\AdventureWorks2.bak',
DISK = 'C:\Backup\MultiFile\AdventureWorks3.bak'
GO
But I want to do this by using Microsoft.SqlServer.Management.Smo.Backup
classes. And I want to get the size of my backup files. Because my
criteria is to split file if my database size exceeds 10 GB otherwise it
will not split my file. SO my issue is how can I get Size of my database
when taking backup. Looking forward to this and Sorry for inconvenience.
Thanks in advance. Quick response is appreciated.
No comments:
Post a Comment