Msg 4102, Level 15, State 1, Line 6
The READPAST lock hint is only allowed on target tables of UPDATE and DELETE and on tables specified in an explicit FROM clause.
This error message appears when you try to use the READPAST hint on the target table of an INSERT statement.
The SQL statement cannot be parsed and further execution is stopped.
Errors of the Severity Level 15 are generated by the user and can be fixed by the SQL Server user. The statement cannot be executed this way. You cannot use the READPAST hint on the target table of an INSERT statement.
All versions of SQL Server.
IF OBJECT_ID (‘dbo.t’) IS NOT NULL
DROP TABLE dbo.t;
CREATE TABLE dbo.t
INSERT INTO dbo.t WITH (READPAST) SELECT 1 ;
In the above example we try to use the READPAST hint on dbo.t in an INSERT statement. This raises the error.