What causes 'Unknown token received from SQL Server'? I have a SQL Server 2005 box with a classic ASP front end (IIS6) calling a stored procedure that uses dynamic SQL. It works except for a single day of data that somehow throws this error even though it runs fine in SSMS.

Since it works for other date ranges and works within SSMS (with this date range), I'm guessing there must be something in the dataset that's triggering the error. However, calls to it using the date range plus filters that result in no data returned still triggers this error, so I don't think it's related to what's being passed back to the IIS app.

Any suggestions on how I can track this down would be appreciated.

Thanks
The error message means client TDS* processing received a token it didn't expect.

This might be a bug, but if so, it is most likely an old one that has long been fixed. You should ensure that the client connectivity components (e.g. MDAC, SQL Server client) are patched up to date (as far as possible, given the old technology).

You should also check that your SQL Server 2005 is running at least Service Pack 4 (though 2005 is out of mainstream support now too).

*tabular data steam; SQL Server's communication protocol