Title

Kodyaz Development Resources

Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Vista, etc.
Welcome to Kodyaz Development Resources Sign in | Join | Help
in Search

Eralper's Blog on Software Development



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

Hi all,

While was working on a CTE select query recently which I use for paging of records for the web application, I got the following error message.

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

Guess, what is causing for this error message in the CTE (Common Table Expression) select statement?

Of course, (NoLock) that I use for the CTE table name.

In order to re-create the same error, I'm copying down a sample CTE select query.

WITH CTE (UserId, Code, Email)
AS
(
SELECT UserId, Code, Email FROM Users (NoLock)
)
SELECT GroupUsers.GroupId, CTE.UserId, CTE.Code, CTE.Email
FROM CTE --(NoLock)
INNER JOIN GroupUsers (NoLock) On GroupUsers.UserId = CTE.UserId

You see, I comment out the (NoLock) table hint after the CTE table name

Published Wednesday, March 21, 2007 11:49 PM by eralper
Filed Under: ,

Comments

No Comments
Anonymous comments are disabled
Copyright © 2004 - 2008 Eralper Yilmaz. All rights reserved.
Powered by Community Server, by Telligent Systems