I am getting an error that I can't open the host file when running bcp
through a tsql statement. When I set the path to a local drive on the sql
server the utility runs. However, when I set the path to a unc path that th
e
server and service account both have permission to then it won't run.
Any ideas on what I should try to fix this problem?Who is the owner of the job? If it is not sa then you will use the account
setup for the Proxy. See this: http://www.support.microsoft.com/?id=269074
Andrew J. Kelly SQL MVP
"John" <John@.discussions.microsoft.com> wrote in message
news:213D9833-AFC6-4122-8BCC-DFEB1BAF945D@.microsoft.com...
>I am getting an error that I can't open the host file when running bcp
> through a tsql statement. When I set the path to a local drive on the sql
> server the utility runs. However, when I set the path to a unc path that
> the
> server and service account both have permission to then it won't run.
> Any ideas on what I should try to fix this problem?|||I don't know if this helps answer your question, but it does not run as a
job. It is running through a stored procedure. DBO is the ower of the
stored procedure.
"Andrew J. Kelly" wrote:
> Who is the owner of the job? If it is not sa then you will use the accoun
t
> setup for the Proxy. See this: [url]http://www.support.microsoft.com/?id=269074[/ur
l]
> --
> Andrew J. Kelly SQL MVP
>
> "John" <John@.discussions.microsoft.com> wrote in message
> news:213D9833-AFC6-4122-8BCC-DFEB1BAF945D@.microsoft.com...
>
>|||Whether it is a job or not still has the requirement of who is trying to
execute xp_cmdshell will determine what account gets used. IN SQL 2000 if
that user is a member of the sa role it will use the account that SQL Agent
is running under. If not it will attempt to use the account that is set for
the Proxy account of SQL Agent. The proxy account most likely does not have
the right permissions. From BOL under xp_cmdshell:
When xp_cmdshell is invoked by a user who is a member of the sysadmin fixed
server role, xp_cmdshell will be executed under the security context in
which the SQL Server service is running. When the user is not a member of
the sysadmin group, xp_cmdshell will impersonate the SQL Server Agent proxy
account, which is specified using xp_sqlagent_proxy_account. If the proxy
account is not available, xp_cmdshell will fail. This is true only for
Microsoft Windows NT 4.0 and Windows 2000. On Windows 9.x, there is no
impersonation and xp_cmdshell is always executed under the security context
of the Windows 9.x user who started SQL Server.
Andrew J. Kelly SQL MVP
"John" <John@.discussions.microsoft.com> wrote in message
news:6C2F8E62-E43B-49AD-8815-C37A56A2FA6E@.microsoft.com...[vbcol=seagreen]
>I don't know if this helps answer your question, but it does not run as a
> job. It is running through a stored procedure. DBO is the ower of the
> stored procedure.
> "Andrew J. Kelly" wrote:
>|||I executed the following:
xp_sqlagent_proxy_account n'get'
It returned an account. I checked the account and it was a member of the
sysadmin role.
To me, it seems like it should be working.
"Andrew J. Kelly" wrote:
> Whether it is a job or not still has the requirement of who is trying to
> execute xp_cmdshell will determine what account gets used. IN SQL 2000 if
> that user is a member of the sa role it will use the account that SQL Agen
t
> is running under. If not it will attempt to use the account that is set f
or
> the Proxy account of SQL Agent. The proxy account most likely does not ha
ve
> the right permissions. From BOL under xp_cmdshell:
> When xp_cmdshell is invoked by a user who is a member of the sysadmin fixe
d
> server role, xp_cmdshell will be executed under the security context in
> which the SQL Server service is running. When the user is not a member of
> the sysadmin group, xp_cmdshell will impersonate the SQL Server Agent prox
y
> account, which is specified using xp_sqlagent_proxy_account. If the proxy
> account is not available, xp_cmdshell will fail. This is true only for
> Microsoft? Windows NT? 4.0 and Windows 2000. On Windows 9.x, there is no
> impersonation and xp_cmdshell is always executed under the security contex
t
> of the Windows 9.x user who started SQL Server.
> --
> Andrew J. Kelly SQL MVP
>
> "John" <John@.discussions.microsoft.com> wrote in message
> news:6C2F8E62-E43B-49AD-8815-C37A56A2FA6E@.microsoft.com...
>
>|||That does not mean it has permissions to access the file share or even the
server. Is that account a domain account with permissions to that share?
The sa part has to do with who is running the command and not the proxy
account. Please read the entry in BOL for xp_cmdshell.
Andrew J. Kelly SQL MVP
"John" <John@.discussions.microsoft.com> wrote in message
news:E95DD8DB-D95A-49DA-8BE8-EC7149C01301@.microsoft.com...[vbcol=seagreen]
>I executed the following:
> xp_sqlagent_proxy_account n'get'
> It returned an account. I checked the account and it was a member of the
> sysadmin role.
> To me, it seems like it should be working.
>
> "Andrew J. Kelly" wrote:
>|||The account is a domain account and does have permissions to the share.
"Andrew J. Kelly" wrote:
> That does not mean it has permissions to access the file share or even the
> server. Is that account a domain account with permissions to that share?
> The sa part has to do with who is running the command and not the proxy
> account. Please read the entry in BOL for xp_cmdshell.
>
> --
> Andrew J. Kelly SQL MVP
>
> "John" <John@.discussions.microsoft.com> wrote in message
> news:E95DD8DB-D95A-49DA-8BE8-EC7149C01301@.microsoft.com...
>
>
没有评论:
发表评论