/*
Unit test the scripts and include the execution results of this script as proof
*/
PRINT 'Date executed: ' + CONVERT(VARCHAR(100), GetDate())
PRINT 'Current User:  ' + SUSER_SNAME()
PRINT 'Server:        ' + @@SERVERNAME

USE [Database]
GO
BEGIN TRANSACTION
GO
Print 'Alter/Create object [object name]'
GO
-- Actual code goes here

-- use go after each block
GO

-- IF ERROR OR  NO TRANSACTION , THEN ROLLBACK TRANSACTION
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN IF @@TRANCOUNT>0 ROLLBACK SET NOEXEC ON END
-- use go after each block
GO

-- IF TRANSACTION COUNT > 0, THEN COMMIT TRANSACTIOON
IF @@TRANCOUNT>0
	COMMIT TRANSACTION
--Compiles each query but does not execute it
SET NOEXEC OFF
GO

