Query to take Back up of database
-Exec P_backupdb
EXEC P_BackupDatabase
/*Create table #TempBackup ( ID int Identity (1,1),DatabaseName varchar(100))
Insert into #TempBackup
Select Database_Name from dbmonitor.dbo.T_Backup Where Backup_Status =1
Declare @ID int
Declare @End int
Set @ID=1
Select @End =MAX(ID) from #TempBackup
Select @End
While ( @ID <=@End )
Begin
Declare @Database varchar(100)
Declare @SQL varchar(max)
Select @Database =DAtabaseName from #TempBackup where ID=@ID
select @Database
set @SQL ='BACKUP Database '+ @Database +' TO Disk=''\\leb-nttcifs01\SystemSupport\backup location for GP002 and DB004\GP002\LEB_Gp002_Data_'+CONVERT(varchar(20),GETDATE(),112)+'_'+@Database+'.Bak'' WITH NOINIT'
EXEC (@SQL)
Set @ID=@ID +1
End
*/
No comments:
Post a Comment