Updated on Kisan Patel
Here is the simple script to backup SQL Server database:
DECLARE @name VARCHAR(50) -- database name DECLARE @path VARCHAR(256) -- path for backup files DECLARE @fileName VARCHAR(256) -- filename for backup DECLARE @fileDate VARCHAR(20) -- used for file name -- specify path SET @path = 'E:\Backup\' -- specify database name SET @name = 'CCRI' -- specify filename SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112) -- merge backup path SET @fileName = @path + @name + '_' + @fileDate + '.BAK' -- execute backup query BACKUP DATABASE @name TO DISK = @fileName