We sometimes create "super insert sprocs" that call other insert sprocs. These "other" insert sprocs often return the Id of of the record they just inserted, but in the case of super insert sprocs, we return the Id of the main (top level) record being added (i.e. Person) and not the Id of a related value added to the record by a separate sproc (i.e. the Id of a telephone number). So we have to swallow the Id of the inner sprocs in a temp table.
The following script (a basic example of what we do) correctly raises an error when run on Microsoft SQL Server 2017...
...but it does NOT raise an error when run on Microsoft SQL Server 2019.
CREATE PROCEDURE ip_MyProcedure
AS
SELECT 1;
GO
CREATE TABLE
#MyTable (
Id int IDENTITY (1, 1) NOT NULL,
RecordId int NULL
);
INSERT INTO
#MyTable (
Id
)
EXECUTE
ip_MyProcedure;
DROP TABLE #MyTable;
GO
DROP PROCEDURE ip_MyProcedure;
GO
However, if the value inserted is changed to a SELECT rather than an EXECUTE, it correctly raises an identity exception in SQL2019.