This Post is a continuation of my previous post. Many times, there is a difficulty in pulling the data to centralized server. As I’ve already mentioned in my previous post PART1, I’m explaining how to pull the DATABASE BACKUP information from all listed instance

In order to execute the below one you need to do a small change (Enable XP_CMDShell only on Centralized Server or where you are intended to schedule a sql job). In this case, below defined parameters needed to be changed with reference to your environment.

IF(@@ROWCOUNT=0)
BEGIN
SET @LOOPSTATUS_1=0
END
ELSE
BEGIN
SET @DML=@DML+’INSERT INTO ['+@DatabaseName+'].dbo.TDATA_BACKUPDETAILS([SERVERNAME],[DBNAME],[LASTBACKUPTAKEN],[BACKUPSIZEINMB],[DAYSSINCEBACKUP],[USERNAME])VALUES(‘+””+@@SERVERNAME+””+’,'+””+@DBNAME+””+’,'+””+@LASTBACKUPTAKEN+””+’,'+””+@BACKUPSIZEINMB+””+’,'+””+@DAYSSINCEBACKUP+””+’,'+””+@USERNAME+””+’)’
END
PRINT @DML
SET @ROWID_1=@ROWID_1+1

Technology enthusiast with 7+ years of experience in Database Technology. I am Microsoft Certified Professional with certificates of OCA, MCP, MCTS, MCITP developer, MCITP administration and backed with a degree in Master of Computer Application. My expertise lies in T-SQL programming, Replication, PowerShell and Performance Tuning. Hobbies are Drawing, playing soccer and listening to Melodies songs.