I have a pagehit function returning the error:
"Syntax error converting the varchar value '*' to a column of data type int."
The function does a count() on an integer column (pagehits), with a where clause matching pagename, and returns the integer pagehits. The function is actually getting called from within a cursor in a stored procedure, and it executes successfully for several pagenames but eventually gives the error when it gets to a particular pagename in the cursor. The function also takes month and year parameters, so I can query for hits during a specific timeframe. Depending on the timeframe, this same pagename will also execute successfully, which makes me think that the return value exceeds that allowable as datatype integer, or something like that. All other pagenames successfully execute. I tried changing the return type to bigint, and got the same message but without the asterisk.
Any ideas? Thanks.
melberti
"Syntax error converting the varchar value '*' to a column of data type int."
The function does a count() on an integer column (pagehits), with a where clause matching pagename, and returns the integer pagehits. The function is actually getting called from within a cursor in a stored procedure, and it executes successfully for several pagenames but eventually gives the error when it gets to a particular pagename in the cursor. The function also takes month and year parameters, so I can query for hits during a specific timeframe. Depending on the timeframe, this same pagename will also execute successfully, which makes me think that the return value exceeds that allowable as datatype integer, or something like that. All other pagenames successfully execute. I tried changing the return type to bigint, and got the same message but without the asterisk.
Any ideas? Thanks.
melberti