SQL Server Restore Verify Only Loop with Update

I’m running a Restore Verify Only loop through a table, but I need it to UPDATE a field in that table if it’s successful. Here is my code: DECLARE @Path NVARCHAR(max) DECLARE @DatabaseName NVARCHAR(100) DECLARE @NSql NVARCHAR(1000) DECLARE @Update NVARCHAR(200) DECLARE @DB_Text NVARCHAR(50)= ‘Backup has been confirmed for’ BEGIN DECLARE @DatabaseId INT = 1, @NumberOfDBs… Read More SQL Server Restore Verify Only Loop with Update