Caché SQL error (ODBC?) - <<METHOD DOES NOT EXIST>Prepare+41^%SYS.SQLSRV *%New,%sqlcq

So just this morning we started to get this error from all of our SQL-client based tools that connect to our Caché SQL via ODBC: 

[%msg: <Error instantiating cached query class in Prepare(): <METHOD DOES NOT EXIST>Prepare+41^%SYS.SQLSRV *%New,%sqlcq>] (State:S1000, Native Code: 190)]


No queries work... any help? stumped over here.


doing a SQL query via Class %SQL.Statement


in Caché command line works... so that's why I think it's an ODBC issue..


I can't seem to find a SQLSRV class in the %SYS documatic

  • 0
  • 0
  • 682
  • 4
  • 2


Go to management portal and purge cached queries.

It's better to address urgent issues (like system availability ones) to WRC.


Sergei, that worked, do you know why purging the cached queries fixes it? and what caused it in the first place?

again, thanks so much

Jason - if you haven't sen Dave's response below, please do so.  If you want this investigated further I recommend opening an issue with InterSystems Worldwide Response Center (WRC... a.k.a. Support Department) by going to  We would be happy to help you figure out what happened, why it happened, and how to prevent it in the future.  

This same issue was reported a week or two ago to the WRC.

Purging cached queries should clear the issue.

It appears to be an issue where the server gets into a state where the cached query class gets an error during creation (that is not reported) and the class is created without any methods.  I believe that customer was on version 2014.1.  Can you please let us know what version you saw this problem on?

Also, if you can reproduce the issue, please contact the WRC with the details.  Thank you.

Also, %SYS.SQLSRV is a routine, not a class, which is why you could not find information on it in documatic.

David, thanks for the detailed explanation. And yes, we're on 2014.1.3.

Will definitely update the thread if I can reproduce

Jason - do you want to look into this some more?  I've tried emailing you a couple times but haven't heard back.