Good Morning Abhi_patil
That is Simple , Sometimes in order to solve a problem you need to break it into smaller problems. First you need to know how you create a Backup in SQl , and this is how its done
-- backup a database
create PROCEDURE [dbo].[sp_BackupDatabase]
@databasename varchar(32),
@path varchar(256),
@filename varchar(64)
AS
set nocount on
declare @sql varchar(4000)
select @sql = 'BACKUP DATABASE ' + ltrim(rtrim( @databasename ))
select @sql = @sql + ' TO DISK = ''' + ltrim(rtrim(@path)) + ltrim(rtrim(@filename)) + ''' '
select @sql = @sql + ' WITH INIT'
--print @sql
execute ( @sql )
select 'Database successfully backed up!' [Result]
and this Accepts
@databasename varchar(32),
@path varchar(256),
@filename varchar(64)
The First Parameter is the Database you want to Backup and the Second parameter is the Path where you want you database backup to be stored and the last part is the name given to the backup.
and in C# you will call this sp as others.
Simple nee :)
Thank you for posting at Dotnetfunda
Vuyiswa Maseko
Thank you for posting at Dotnetfunda
[Administrator]
Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator