Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Error running job to a linked server?

Author  Topic 

simpleton
Starting Member

25 Posts

Posted - 2008-04-17 : 10:17:41
I created a TSQL insert query that runs between two SQL 2000 SP3 servers.
It works great from Query Analyzer.

When I try to run it as a job, I get this error:
"Msg 7410, Sev 16: Remote access not allowed for Windows NT user activated by SETUSER. [SQLSTATE 42000]"

I have changed ownership and execution of the job, but no luck.
I turned the TSQL into a Stored Procedure (which works fine), and then told my job to run it with OSQL, but that job failed too.
I have run through several routines I found in Google, but no luck.


What is my best bet?

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-04-17 : 11:37:44
Try mapping with SQL login. How did you map linked server? and your job uses trusted connection.
Go to Top of Page

simpleton
Starting Member

25 Posts

Posted - 2008-04-17 : 15:08:26
I have linked server setup to to use "local login" as mydomain\saadmin and impersonate is checked.
And there is another box checked "for login not defined in list, use this security context:" and we have SA + password.

I don't see an option for "trusted connection"
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-04-17 : 15:16:14
Don't setup linked server with sa password.what is your statement for it?
Go to Top of Page

simpleton
Starting Member

25 Posts

Posted - 2008-04-17 : 15:39:38
Thanks for your help!
I don't have a statement. I used Enterprise Manager.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-04-17 : 22:09:48
What's sql agent service account? Can you post your insert statement?
Go to Top of Page

simpleton
Starting Member

25 Posts

Posted - 2008-04-18 : 12:00:13
Thanks for all the help on this!
The statement runs fine from Query Analyzer, but is dying when run as a job.

INSERT INTO [SERVER2].NotesTable.dbo.ItemNotes(item)
SELECT dbo.ItemTable.ItemNumber
FROM dbo.ItemTable LEFT OUTER JOIN
[SERVER2].Notes.dbo.ItemNotes AS ItemNotes ON dbo.ItemTable.ItemNumber = ItemNotes.item COLLATE LATIN1_GENERAL_BIN
WHERE ItemNotes.item IS NULL
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-04-19 : 17:10:47
How did you map user to sql login on linked server?
Go to Top of Page
   

- Advertisement -