Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

INF: How Sp_OA Procedures Extension to SQL Server Is Implemented


View products that this article applies to.

Summary

This article describes how the sp_OA procedures or Microsoft Visual Basic for Applications extension to SQL Server is implemented.

↑ Back to the top


More information

The sp_OA procedures (OA stands for OLE Automation) like sp_OACreate, sp_OAMethod, and so on, allow a connection, through Transact-SQL commands, to create and use Component Object Model (COM) based objects. The procedures are built into SQL Server as an extended stored procedure (XPROC), contained in Sqlole32.dll. This is another powerful example of how SQL Server behavior can be extended with an XPROC implementation. For more information, see the following article in the Microsoft Knowledge Base:
152801 : Examples of Sp_OA Procedure Use and SQLOLE.Transfer Object

When the first attempt to create any COM object takes place, the sp_OA internal functions identify that it is the first time. A new thread is created by the XPROC that performs the CoInitialize call and handles a standard windows message loop. This becomes the apartment thread for sp_OA operations.



As always, make sure your COM activities are minimized when you have an open transaction. The COM operations could lead to extended transaction times and reduced concurrency.

NOTE: If you have written an in-process server or your own Proxy/Stub for an out-of-process server, remember that it runs in the process space of SQL Server.

↑ Back to the top


Properties

Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

↑ Back to the top


Keywords: kbinfo, KB180780

↑ Back to the top

Article Info
Article ID : 180780
Revision : 3
Created on : 10/3/2003
Published on : 10/3/2003
Exists online : False
Views : 348