Solved

SQL Server Agent TSQL Query using sp_OACreate. What NT security does the dbo SQL user have?

Posted on 2004-04-29
1
631 Views
Last Modified: 2011-08-18
I have a TSQL script that calls a COM object from it. The running user (SQL Agent scheduler) runs it with a dbo login from SQL so who's security does it connect to the COM object as? The login process of SQL Agent, the login process of SQL server or something else?

DECLARE @oQBXMLrp int
DECLARE @iHR int
DECLARE @iCnt int
DECLARE @sSource varchar(255)
DECLARE @sDesc varchar(255)
DECLARE @sObjectName varchar(255)

SET @iCnt = 1
SELECT "Current User: " = CURRENT_USER, " Time: " = CONVERT(char(30), CURRENT_TIMESTAMP)
WHILE @iCnt < 6 BEGIN
    SET @sObjectName = CASE @iCnt
        WHEN 1 THEN 'QBXMLRPEQODBCInteractive.RequestProcessor'
        WHEN 2 THEN 'QBXMLRP.RequestProcessor'
        WHEN 3 THEN 'QBXMLRP2EQODBCInteractive.RequestProcessor'
        WHEN 4 THEN 'QBXMLRP2.RequestProcessor'
        ELSE 'Xerces.DOMDocument'
    END
    EXEC @iHR = sp_OACreate @sObjectName, @oQBXMLrp OUT
    IF @iHR <> 0 BEGIN
        EXEC sp_OAGetErrorInfo @oQBXMLrp, @sSource OUT, @sDesc OUT
        SELECT "Object" = @sObjectName, "Function" = 'CreateObject', "HR" = convert(varbinary(4),@iHR), "Source" = @sSource, "Description" = @sDesc
    END
    ELSE BEGIN
        SELECT "Object" = @sObjectName, "Function" = 'CreateObject', "HR" = convert(varbinary(4),0), "Source" = '', "Description" = 'Successfully Created'
    END

    EXEC @iHR = sp_OADestroy @oQBXMLrp
    SET @iCnt = @iCnt + 1
END
0
Comment
Question by:azfronz
1 Comment
 
LVL 34

Accepted Solution

by:
arbert earned 500 total points
Comment Utility
If it's actually running under the scheduler, it would be called with the SQLAgent USER/Password....
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how the fundamental information of how to create a table.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now