On larger DDL scripts for deployments, usage of SET NOEXEC ON as part of error handling is commonplace to prevent execution of downstream code. If coupled with SET NOCOUNT ON, there's a chance code execution may be inadvertently suppressed unless the proper post-deployment checks are done. I checked sys.dm_exec_sessions and there is no attribute for either SET statement. Is there an alternate method of checking the status of either statement for the current session or any user's session from the DBA perspective?
Here's a quick example...
CREATE TABLE dbo.MJZTest
(Col1 int)
ON [PRIMARY2]
GO
IF @@ERROR<>0
SET NOEXEC ON
INSERT INTO dbo.MJZTest (Col1)
VALUES (1)
GO
In the above example, if the [PRIMARY2] filegroup doesn't exist, preventing table creation, the @@ERROR check will call the SET NOEXEC ON statement which will prevent actual execution of the subsequent INSERT statement. I've seen this type of code generation with tools such as RedGate SQL Compare.
The catch is, if the person executing the code neglects to run SET NOEXEC OFF to reset the session during debugging, they may get a Command(s) completed successfully. message regardless of the actual outcome.