I want to take my database backup every 1 hour in .net is there any way to take a backup of the database in the root folder
How to take database backup automatically after 1 hour in .NET
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Vishal YelveRank #178 · 13.6K reputationPosted Oct 13, 2023, 9:43 AM EDT
Hi Harsh,
you can create a programe to execute below sql script to take backup of your databse every 1hour.
declare @backuppath as nvarchar(max) set @backuppath = N'C:\WorkingProjects\Practice\DataBase\Employee\EmployeeDB_' + CONVERT(nvarchar,YEAR(getdate())) + CONVERT(nvarchar,Month(getdate())) + + CONVERT(nvarchar,DAY(getdate())) + '.bak' Backup Database [EmployeeDB] to DISK = @backuppath WITH NOFORMAT, NOINIT, NAME=N'EmployeeDB-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GOSam HobbsRank #107 · 20.5K reputationPosted Oct 14, 2023, 1:59 PM EDT
The Windows Task Scheduler can be used to execute a program every hour.