back up sql data programmetically
-
hi, I am using sql database with asp.net in c#.I have a database application.HOw can i back up the data programmetically? regards Bill
Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
hi, I am using sql database with asp.net in c#.I have a database application.HOw can i back up the data programmetically? regards Bill
-
hi, I am using sql database with asp.net in c#.I have a database application.HOw can i back up the data programmetically? regards Bill
-
hi, I am using sql database with asp.net in c#.I have a database application.HOw can i back up the data programmetically? regards Bill
That is Simple
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go-- backup a database
ALTER 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]
Welcome :)
Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/