You receive an exception when you call an extended stored procedure from a Visual Studio .NET application (884806)
The information in this article applies to:
- Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2003), Professional Edition
- Microsoft Visual Studio .NET (2003), Academic Edition
SYMPTOMSWhen you call an extended stored procedure from a Microsoft Visual Studio .NET application by using the SqlClient namespace, you may receive the following exception message: A severe error occurred on the current command. The results, if any, should be discarded. WORKAROUNDTo work around this problem, follow these steps: - Run the following command in SQL Query Analyzer:
use master
go
sp_dropextendedproc 'xp_proc'
dbcc xp_proc (free)
go - Locate the following lines of code in the proc.cpp file in the extended stored procedure project (XP_Proc):
srv_senddone(srvproc, SRV_DONE_ERROR | SRV_DONE_MORE, 0, 0);
return XP_ERROR ;
- Replace these lines of code with the following code:
srv_senddone(srvproc, SRV_DONE_MORE | SRV_DONE_COUNT, (DBUSMALLINT)0, (DBINT)i);
return XP_NOERROR; - Rebuild the extended stored procedure project.
- Copy the XP_Proc.dll file to the sqlserverpath\MSSQL\Binn folder on the computer that is running Microsoft SQL Server.
Note sqlserverpath is a placeholder for the path of the folder where SQL Server is installed. - Run the following command in SQL Query Analyzer:
use master
go
sp_addextendedproc 'xp_proc','XP_Proc.dll'
STATUS This behavior is by design.REFERENCES
For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
156099
How to debug an extended stored procedure
190987 How to use extended stored procedures
151596 Extended procedure error: "Cannot find the DLL 'xxx.dll'"
Modification Type: | Major | Last Reviewed: | 9/8/2004 |
---|
Keywords: | kbStoredProc kbSqlClient kbServer kbProvider kbNameSpace kbDLL kbADO kbtshoot kbprb KB884806 kbAudDeveloper |
---|
|