Code Inspection: Unreachable code
Configure inspections: Settings | Editor | Inspections
Show intention actions: AltEnter
Reports unreachable statements inside SQL routines.
Example (Microsoft SQL Server):
CREATE FUNCTION foo() RETURNS INT AS
BEGIN
THROW;
RETURN 1;
END;
In Microsoft SQL Server, the THROW
statement raises an exception and transfers execution to the CATCH block of the TRY...CATCH construct. Therefore, the RETURN 1;
part will never be executed.
Place the caret at the highlighted line and press AltEnter or click
.
Click the arrow next to the inspection you want to suppress and select the necessary suppress action.