BACKUP DATABASE [weather] TO  DISK = N'D:\Cumulus\backup\sqlserver\sqlserverbackupscript' WITH NOFORMAT, NOINIT,  NAME = N'weather-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO
declare @backupSetId as int
select @backupSetId = position from msdb..backupset where database_name=N'weather' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N'weather' )
if @backupSetId is null begin raiserror(N'Verify failed. Backup information for database ''weather'' not found.', 16, 1) end
RESTORE VERIFYONLY FROM  DISK = N'D:\Cumulus\backup\sqlserver\sqlserverbackupscript' WITH  FILE = @backupSetId,  NOUNLOAD,  NOREWIND
GO
