Msg 494, Level 16, State 1, Line 4
The TABLESAMPLE clause can only be used with local tables.
This error message appears when you try to use the TABLESAMPLE clause with a non-local table.
The T-SQL statement can be parsed, but causes the error at runtime.
Errors of the Severity Level 16 are generated by the user and can be fixed by the SQL Server user. The statement cannot be executed this way. The TABLESAMPLE clause can only be used with local tables.
This error message was introduced with SQL Server 2005.
DECLARE @f int;
SET @f = 100;
INFORMATION_SCHEMA.TABLES TABLESAMPLE (@f ROWS);
In the above example we try to use the TABLESAMPLE clause for the INFORMATION_SCHEMA.TABLES view. This raises the error.