Re: bcp error

From: Andrew J. Kelly (sqlmvpnooospam_at_shadhawk.com)
Date: 01/14/05


Date: Fri, 14 Jan 2005 15:40:27 -0500

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...
>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 
>> 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?
>>
>>
>> 


Relevant Pages

  • Re: SQL account rights
    ... Please advice what is the best, suitable rights rather than domain admin ... Warren Brunk - MCITP - SQL 2005, ... Add it as a login to the SQL Server ... files, or backups, make sure that the service account has Full ...
    (microsoft.public.sqlserver.security)
  • Re: User authentication
    ... There are 2 SQL Server 2005 ... 1 SQL Server 2000 installed on another server ... Windows account instead to run backup jobs. ...
    (microsoft.public.sqlserver.clients)
  • Re: SQL 2000 Server gets hacked
    ... Thank you Beth. ... > placed a strong password on the 'sa' account?) ... Your SQl Service itself shouldn't be running as a ... (SQL Agent requires more, but not SQL Server). ...
    (microsoft.public.sqlserver.security)
  • Re: SQL 2000 Server gets hacked
    ... Thank you Beth. ... > placed a strong password on the 'sa' account?) ... Your SQl Service itself shouldn't be running as a ... (SQL Agent requires more, but not SQL Server). ...
    (microsoft.public.sqlserver.security)
  • Re: Microsoft Search service cannot be administered under the present user error SP3
    ... - Have not modified Administrator account, but i ran the SQL script anyway. ... SQL account is not a local administrator. ... > has this server ever been upgrade from SQL Server 7.0 or is this SQL ...
    (microsoft.public.sqlserver.fulltext)