b00gieman


Hi!

I've written an scheduled job for importing an excel file into a sql table.When I try to run the job from Sql server agent , I get the status 'Not running',and in the last run status,it's written 'failed'.I've tested the command before in the query analyzer,and it works.Can someone tell me why isn't this working as a scheduled job

Thanks in advance!





Re: scheduled task not running

dyarwood


Any chance of seeing the command Initial thoughts might be if the file is locked or opened somewhere else. Does the user that the SQL Server Agent run under has permissions to access the file Have you looked at the job history for any clues






Re: scheduled task not running

b00gieman

The command is:

INSERT INTO <sql table> SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=<excel file>;hdr=yes', 'SELECT * FROM [Sheet1$]')
Code Block


The file was closed...Could the result 'not running' be the result of a insufficient permission to run the scheduled job






Re: scheduled task not running

b00gieman

I've looked at 'job history'...It has a constant result of 'failed'.When I look into the step details,the following message is written:

Remote access not allowed for Windows NT user activated by SETUSER. [SQLSTATE 42000] (Error 7410). The step failed.

It seems that I don't have enough permissions...Sad






Re: scheduled task not running

dyarwood

I would suspect that user that the job (SQL Server Agent) is running under does not have access to that file. Find out what user the SQL Server Agent is running under and then check that user has permissions on the file and folder.