Microsoft SQL System Extendend Stored Procedure Overwrite sp_executesql
Posted on 2004-08-03
I want to modifiy a SQL statement that is being executed on the SQL server. It is being generated from what I can tell, a dll (Sharepoint), so I cannot modify it directly. My idea was to rename the sp_executesql and then add a new xp with the same name. That way the dll would call my custom version, which would modify the sql statement and the call the original but renamed version to get the results
After renaming sp_executesql to sp_executesql2, the ext sp, it says ODBC: Msg 0, Level 16, State 1
Cannot load the DLL (server internal), or one of the DLLs it references. Reason: 126(The specified module could not be found.).
Additionally, it seems that if i just delete the original, and add my custom xp using the same name, sp_executesql, whatever the dll is doesn't do anything and the original behavior is restored.
I am working on a Virtual PC so I dont complete screw up existing development dbs. SQL Server 2000.
Thanks in advance.