Solved

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

Posted on 2004-04-29
1
633 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
ID: 10954120
If it's actually running under the scheduler, it would be called with the SQLAgent USER/Password....
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

912 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

21 Experts available now in Live!

Get 1:1 Help Now