Quantcast
Channel: SQL Server High Availability and Disaster Recovery forum
Viewing all articles
Browse latest Browse all 4532

Write Job function for the DB backup- MS SQL

$
0
0

This is my code for the 2 DB backup in the Job function. It's worked but DB size (0 files. What's the reason. 

----------------------------------------------------------------------------------------------------------

USE master
GO
DECLARE @path VARCHAR(100) -- path for backup files  
DECLARE @path2 VARCHAR(100) -- path for backup files  

set @pathIms2='D:\Backup_Schedule_Folder\ims2'+ cast(GETDATE()as varchar(20)) + '.bak'
set @pathMydb='D:\Backup_Schedule_Folder\mydb'+ cast(GETDATE()as varchar(20)) + '.bak'

BACKUP DATABASE [ims2]
TO  DISK = @pathIms2

BACKUP DATABASE [mydb]
   TO  DISK = @pathMydb

GO



Viewing all articles
Browse latest Browse all 4532

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>