Parameters supplied for object 'Table Name' which is not a function. If the parameters are intended as a table hint, a WITH keyword is required.

When I execute the following statement, The error occurred...

SELECT * FROM Tb_Table1(NOIOCK)
Go

Error:
Msg 207, Level 16, State 1, Line 1
Invalid column name 'NOIOCK'.
Msg 215, Level 16, State 1, Line 1
Parameters supplied for object 'Tb_Table1' which is not a function. If the parameters are intended as a table hint, a WITH keyword is required.

Reason:
The error because of Typo error... "NOIOCK" is not a valid table hint...But, If we try to change the statement with "WITH" keyword, The following error will be the exact one...
 
SELECT * FROM Tb_Table1 With(NOIOCK)
Go

Error:
Msg 321, Level 15, State 1, Line 1
"NOIOCK" is not a recognized table hints option. If it is intended as a parameter to a table-valued function or to the CHANGETABLE function, ensure that your database compatibility mode is set to 90.

So, The source of the error is the Table hint "NOIOCK"

The actual statement/recommended format is...

SELECT Column1, Column2,... FROM Tb_Table1 With(Nolock)
Go

The following are the possible table hints...
 


 

No comments:

Post a Comment