USE master;
GO

DECLARE @SrcDB NVARCHAR(128) = 'ProdDUTASJobSchedule';
DECLARE @BackupPath NVARCHAR(260) = '\\DOES-RAINVM-PRD\E$\Neeraj\SqlAgent\Backup\' + @SrcDB + '.bak';
DECLARE @SQL NVARCHAR(MAX);

-- Dynamic SQL for backup
SET @SQL = '
BACKUP DATABASE [' + @SrcDB + ']
TO DISK = N''' + @BackupPath + '''
WITH INIT, COMPRESSION, STATS = 10;
';

-- Execute backup
EXEC(@SQL);

PRINT 'Backup completed: ' + @BackupPath;
GO
