Its possible to stop install when i provide a RAISERROR in my SQL Script? In my tests the installer keeps running. I want to stop when my backup integrity check fails. For testing purposes, i wrote this snippet inside SQL Scripts in Advanced Installer:
Code: Select all
USE [DE]
BEGIN TRY
RESTORE VERIFYONLY
FROM DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.DOMINIOEMP1\MSSQL\Backup\DE.bak'
WITH
FILE = 1,
NOUNLOAD,
NOREWIND
END TRY
BEGIN CATCH
RAISERROR(N'Corrupted backup file', 16, 1) /* i want to stop install after raiserror */
END CATCH
GO
FOLLOW US
Get the latest news in Application Packaging