Recap

COM is a powerful and pervasive technology that enables applications to interoperate in a wide variety of ways. Thanks to ODSOLE, Transact-SQL can access COM object interfaces exposed by other applications and even by SQL Server itself. By combining the power of a relational database with the flexibility and ubiquity of Automation, you can build applications that are very powerful indeed.

SQL Server's ODSOLE facility uses late binding to interact with COM objects. This means that it makes calls to the IDispatch COM interface, similarly to traditional scripting languages such as VBScript and JScript.

ODSOLE makes use of the STA threading model. When first initialized, it creates the main STA if it has not already been created. In the STA model, access from other apartments is coordinated via Windows messages.

You create COM object instances from Transact-SQL using sp_OACreate, and you destroy them via sp_OADestroy. Any objects that aren't destroyed when the batch completes are automatically released by one of the two batch termination handlers ODSOLE sets up when an sp_OA proc is first called on a worker thread.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.76.89