INF: How Sp_OA Procedures Extension to SQL Server Is Implemented

Last reviewed: February 10, 1998
Article ID: Q180780
The information in this article applies to:
  • Microsoft SQL Server, version 6.5

SUMMARY

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

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:

   ARTICLE-ID: Q152801
   TITLE     : 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.


Additional query words: VBA tsql
Keywords : SSrvProg
Version : WINNT:6.5
Platform : winnt
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 10, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.