如何授予对SQL Server代理的访问权限,以便能够写入/修改系统文件? [英] How do I grant access to SQL Server Agent to be able to write/modify system files?

查看:350
本文介绍了如何授予对SQL Server代理的访问权限,以便能够写入/修改系统文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个工作,该工作具有一个存储过程,该存储过程运行BCP以查询一些数据.

I have a job that has a stored procedure that runs BCP to QUERYOUT some data.

如果我自己运行QUERYOUT命令,它将起作用.

If I run the QUERYOUT command by itself, it works.

但是,如果我尝试在JOB中运行它,它将创建文件,但会挂起",并且永远不会将数据放入文件中.它永远挂着,所以我通常会终止BCP.exe.

However, if I try to run it in a JOB, it creates the file but "hangs" and the data is never put in the file. This hangs forever so I usually terminate the BCP.exe.

我的问题是:

我如何获得一个SQL作业来运行BCP以执行QUERYOUT并具有执行该权限的权限?

How do I get a SQL job to run BCP to do a QUERYOUT and have the permissions to do so?

QUERYOUT将进入C:\驱动器(因此没有任何花哨的东西).

The QUERYOUT is going to the C:\ drive (so nothing fancy or anything).

这个问题使我发疯,并且无法在线阅读,似乎运行作业的用户需要对该文件夹的权限.该文件夹不受保护或其他任何保护.

This problem is driving me nuts and from reading online, it looks like the user that runs the jobs needs permissions to the folder. The folder isn't protected or anything.

SQL作业的所有者是SQL的SYS ADMIN组的一部分.

The owner of the SQL job is part of the SYS ADMIN group in SQL.

任何帮助将不胜感激.

推荐答案

检查将哪些用户分配给SQL Server代理服务.打开services.msc,找到SQL Server代理并检查登录"属性.将有一个LocalSystem用户(不太可能根据您的描述)或另一个用户.

check what user is assigned to SQL Server Agent service. Open services.msc, locate the SQL Server Agent and check Logon properties. There will be either a LocalSystem user (unlikely, based on what you have described) or another user.

检查用户是否对您尝试写入BCP转储的文件夹具有写入"访问权限.

Check that the user has "Write" access to the folder where you are trying to write the BCP dump.

这篇关于如何授予对SQL Server代理的访问权限,以便能够写入/修改系统文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆