I am testing how to use explicit transactions. In my table, there is no employee with an ID of 200005, so this should generate an error, then the CATCH block should execute right? The results window says (0 rows affected) and the bottom of the results window it says 'Query executed successfully.'
Why isn't this resulting in an error with the CATCH block being executed?
BEGIN TRANSACTION selectEmpID
SET firstName = 'Mike'
WHERE employeeID = 200005 --there is no employee with an ID of 200005 so this should generate an error right?
BEGIN COMMIT TRANSACTION selectEmpID
PRINT 'This is an error message'
BEGIN ROLLBACK TRANSACTION selectEmpID