I have one asp.net 2.0 application with MS Sql 2005 database.. As i deploy this database with client Machine.. now what i need is i need to take a backup of MS Sql 2004 database.. so is that any free tool is available which take daily backup...
You can create two stored procedure for this purpose and schedule those procedure in sql job. It will execute automatically and take backup and restore the database. For this purpose you need not to have a third party tool
ALTER PROCEDURE [dbo].[usp_BackUpDatabase]
(
@DatabaseName AS VARCHAR(50),
@FilePath AS VARCHAR(2000)
)
AS
BEGIN
DECLARE @FileDate VARCHAR(20)
DECLARE @FileName VARCHAR(255)
SELECT @FileDate = CONVERT(VARCHAR(20),GETDATE(),112)+ Replace(CONVERT(VARCHAR(20),GETDATE(),114),':','')
SET @FileName = @FilePath +'\'+ @DatabaseName + '_' + @FileDate + '.bak'
BACKUP DATABASE @DatabaseName TO DISK = @FileName
END
for restore
next create two sql jobs and scedule the above two stored procedure in the job...for job scheduling please follow the steps mentioned in the follwoing link
oh..sql server express edition does have sql agent. SQL Agent comes with sql server enterprise, standard and developer edition.
In this scenario you can do one thing as mentioned write those sp and create windows service and execute the sp's inside the windows service after a certain time. This will do the same.
And as per the bakup file's name concern replace the follwoing line
But i dont know how to create windows service and execute my procedure.
so if you dont mind can you create a widows service for me.. Coz im a fresher here asp.net C# i dont know how to do..
I need step by step code how to create and execute..
If you really want to help me then let me know by step by step code in asp.net C#..
Once again Thank you Arefinn.. and your great support..
2) one more would you please let me know the cost of sql server enterprise, standard and developer edition... in Inida.. and Sql express support how many gb per database...
see this link...its demonstarte how to create a windows service step by step...and write a code to execute sp in windows service same way you done in asp.net or any other .net application
Secondly if you need sql server for practice purpose then you probably use the trial version instead of buying it.
you can download sql server 3 months trial from here
gopi007
Member
62 Points
418 Posts
any free tool that take automatic backup and Restore of Sql server 2005
Aug 03, 2010 05:27 PM|LINK
Hi..
I have one asp.net 2.0 application with MS Sql 2005 database.. As i deploy this database with client Machine.. now what i need is i need to take a backup of MS Sql 2004 database.. so is that any free tool is available which take daily backup...
Please Let me know itz very urgent
arefinn
Contributor
4992 Points
750 Posts
Re: any free tool that take automatic backup and Restore of Sql server 2005
Aug 03, 2010 07:29 PM|LINK
You can create two stored procedure for this purpose and schedule those procedure in sql job. It will execute automatically and take backup and restore the database. For this purpose you need not to have a third party tool
gopi007
Member
62 Points
418 Posts
Re: any free tool that take automatic backup and Restore of Sql server 2005
Aug 04, 2010 04:12 AM|LINK
Can you tell me how to do step by step?
arefinn
Contributor
4992 Points
750 Posts
Re: any free tool that take automatic backup and Restore of Sql server 2005
Aug 04, 2010 08:20 AM|LINK
Write two stored procedures..
for back up
for restore
next create two sql jobs and scedule the above two stored procedure in the job...for job scheduling please follow the steps mentioned in the follwoing link
http://msdn.microsoft.com/en-us/library/ms191439.aspx
gopi007
Member
62 Points
418 Posts
Re: any free tool that take automatic backup and Restore of Sql server 2005
Aug 04, 2010 08:59 AM|LINK
Hi ...
Thanx 4 ur kind reply ...
In my management studio i dnt have SQL Server Agent option ....
wats z is the problem ...? wat should i do ...
Here am using sql server 2005 express ....
Plz help
2nd
One more thing is
the backup file name is like this mrp_20100804142622613.bak ....
But i want in proper format mrp_04-Aug-2010_02:26.bak
arefinn
Contributor
4992 Points
750 Posts
Re: any free tool that take automatic backup and Restore of Sql server 2005
Aug 04, 2010 12:33 PM|LINK
oh..sql server express edition does have sql agent. SQL Agent comes with sql server enterprise, standard and developer edition.
In this scenario you can do one thing as mentioned write those sp and create windows service and execute the sp's inside the windows service after a certain time. This will do the same.
And as per the bakup file's name concern replace the follwoing line
SELECT @FileDate = CONVERT(VARCHAR(20),GETDATE(),112)+ Replace(CONVERT(VARCHAR(20),GETDATE(),114),':','')
with the following line
SELECT @FileDate = CONVERT(VARCHAR,GETDATE(),106) + CONVERT(VARCHAR(5),GETDATE(),114)
gopi007
Member
62 Points
418 Posts
Re: any free tool that take automatic backup and Restore of Sql server 2005
Aug 04, 2010 01:13 PM|LINK
Thank you man for your code..
But i dont know how to create windows service and execute my procedure.
so if you dont mind can you create a widows service for me.. Coz im a fresher here asp.net C# i dont know how to do..
I need step by step code how to create and execute..
If you really want to help me then let me know by step by step code in asp.net C#..
Once again Thank you Arefinn.. and your great support..
2) one more would you please let me know the cost of sql server enterprise, standard and developer edition... in Inida.. and Sql express support how many gb per database...
Hope you do the needfull
arefinn
Contributor
4992 Points
750 Posts
Re: any free tool that take automatic backup and Restore of Sql server 2005
Aug 04, 2010 01:51 PM|LINK
see this link...its demonstarte how to create a windows service step by step...and write a code to execute sp in windows service same way you done in asp.net or any other .net application
Secondly if you need sql server for practice purpose then you probably use the trial version instead of buying it.
you can download sql server 3 months trial from here
http://www.microsoft.com/sqlserver/2005/en/us/trial-software.aspx
gopi007
Member
62 Points
418 Posts
Re: any free tool that take automatic backup and Restore of Sql server 2005
Aug 04, 2010 01:57 PM|LINK
Please create a windows service for me.. coz i dont know how to do..? and let me know step by step with comments..
hope you do the needfull arefinn
Thankx
arefinn
Contributor
4992 Points
750 Posts
Re: any free tool that take automatic backup and Restore of Sql server 2005
Aug 04, 2010 01:57 PM|LINK
sql server expresss edition supports only 4gb of database
check out the link
http://www.microsoft.com/sqlserver/2005/en/us/compare-features.aspx
Also check out the price list
http://www.microsoftstore.co.in/microsoft/55/productlist/allsoftware.aspx