DECLARE @name AS VARCHAR(50)DECLARE @FileName AS VARCHAR(50)DECLARE @filedate AS VARCHAR(50)SELECT @filedate =CONVERT(VARCHAR(20),GETDATE(),112)DECLARE Db_cursor CURSOR FOR SELECT * NAME FROM MASTER.dbo.sysdatabasesWHERE NAME NOT IN ('master','model','msdb','tempdb') OPEN Db_cursor FETCH NEXT FROM Db_cursor INTO @nameWHILE @@FETCH_STATUS = 0BEGIN SET @FileName = 'E:\dhaval\' + @name + '_' + @filedate + '.Bak'BACKUP DATABASE @name TO DISK = @FileNameEND
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: