SQL Feature to Integrate with COM Objects

SQL Feature to Integrate with COM Objects

SQL Server has a very powerful, but often overlooked, feature to integrate with COM objects. SQL itself can create COM objects from within Triggers or Stored Procedures, apply property values and execute methods. What you commonly see in Visual Basic, and other languages, that looks similar to:

 Set oFoo = CreateObject("Foo.cFoo")oFoo.Condition = "Quantity Low"oFoo.Responsible = "Joe Karbowski"oFoo.SendPagerMsgSet oFoo = Nothing

you can also do in SQL Server T-SQL sp_OA calls. This is especially useful if you need to take action that isn’t necessarily associated with a database, like dialing a pager or integrating to custom middleware. The power comes in the reuse of you COM components and enforcing a single set of business rules.


Share the Post: