Discussion Locked

SQL job in VBScript gives Access Denied

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a SQL job, written in VBScript, that generates a text file with data from a database.

The job executes without errors as long as the file is saved to the local disk. But when trying to save it to another server within the same domain it fails, not giving any specific errors of why.

So I let the job save the file to the local disk, and created a second step, Cmd Exec type, to move the file to the other server. This also fails, reporting "Access Denied" for the local file.

The administrator account is set as the Owner of the job and when using Windows Explorer there are no problems copying files between the two servers.

Why am I getting the "Access Denied" error, and how can the task be achieved?

3 replies

by c_kelley

I don't know if this will help or not. I had a similar problem involving SQL and IIS. The problem turned out to be that the accounts where not the same for IIS, SQL and the NT box. The account had to not only be the same, but also have sufficientpermissions on all 3 in order to run the job, post to an IIS folder and transfer the file within the domain. I ended up using an admin account for the NT domain and setting it as an owner on the SQL db as well as admin on the IIS services.

This discussion is closed to new replies.