• subahan.munthamadugu

    SSChasing Mays

    Points: 630

    Hi,

    in your environment having test servers ? then create one linked server for that 2005 server(express edition) and create job for taking backup in your test servers.

    note: in backup command you should have mention the path like '\\your 2005express edition location path'

    script: create one job by using the below script in your test server and make sure your mentioned path like '\\ D:\ yoursql server2005 express edition\backup\......'

    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 database backup directory

    SET @path = '\\C:\Backup\'

    -- specify filename format

    SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112)

    DECLARE db_cursor CURSOR FOR

    SELECT name

    FROM master.dbo.sysdatabases

    WHERE name NOT IN ('master','model','msdb','tempdb') -- exclude these databases

    OPEN db_cursor

    FETCH NEXT FROM db_cursor INTO @name

    WHILE @@FETCH_STATUS = 0

    BEGIN

    SET @fileName = @path + @name + '_' + @fileDate + '.BAK'

    BACKUP DATABASE @name TO DISK = @fileName

    FETCH NEXT FROM db_cursor INTO @name

    END

    CLOSE db_cursor

    DEALLOCATE db_cursor

    subahan munthamadugu