Re: BCP, Bulk Insert

From: oj (nospam_ojngo_at_home.com)
Date: 03/25/04


Date: Thu, 25 Mar 2004 10:30:45 -0800

nytime you specify \\servername\shared through xp_cmdshell, NT permission is
check. If the user is a sql admin then the account used to start sqlserver
service will be used for authentication. If the user is not a sql admin, sql
proxy account is used.

http://msdn.microsoft.com/library/en-us/tsqlref/ts_xp_aa-sz_4jxo.asp

Since you're specifying c$, an NT admin account is needed to access the
data. That means the sqlserver service account or the proxy account must be
an NT admin on the \\server you're trying to access.

-- 
-oj
http://www.rac4sql.net
"Anand" <anonymous@discussions.microsoft.com> wrote in message
news:1a6101c41276$f0421500$7d02280a@phx.gbl...
> Hi,
>
> Problem in importing the data from .dast file to sql
> server by osql, bcp and bulk insert using the sql server
> client.
>
> I am working in my machine, call it as testuser (machine
> name).
>
> And sql server is located in the machince, call it as
> testserver (machine name).
>
> OSQL Query:
>
> OSQL -S myserver -U sa -P sa -d mydatabase -b -n -l60 -
> Q "EXEC master..xp_cmdshell 'BCP "mydatabase..table_temp"
> in "c:\ServicesOffice.dat" -c'"
>
> BCP Query:
>
> BCP mydatabase..table_temp in 'c:\ServicesOffice.dat' -c -
> S myserver -U sa -P sa
>
> Bulk Insert:
>
> BULK INSERT table_services_office_scrub_temp
>    FROM 'c:\ServicesOffice.dat'
>
>
> All the above query are working fine if the
> ServicesOffice.dat file is located in the server
> (testserver).
>
> But it is not accessable if i specify my machine path.
>
> ie,
>
> OSQL Query:
>
> OSQL -S myserver -U sa -P sa -d mydatabase -b -n -l60 -
> Q "EXEC master..xp_cmdshell 'BCP "mydatabase..table_temp"
> in "\\testuser\c$\ServicesOffice.dat" -c'"
>
> BCP Query:
>
> BCP database..table_temp
> in '\\testuser\c$\ServicesOffice.dat' -c -S myserver -U
> sa -P sa
>
> Bulk Insert:
>
> BULK INSERT table_services_office_scrub_temp
>    FROM '\\testuser\c$\ServicesOffice.dat'
>
> how can i import file ?
>
> With Thanks and Regards,
> Anand
>


Relevant Pages

  • Re: How to populate a list box based on user input?
    ... associated with that account pop up in a list box. ... click "View" and a query come up showing all those orders on separate ... I get stuck on what the SQL should look like in the Control Source ... Private Sub txtAccountNo_AfterUpdate ...
    (microsoft.public.access.modulesdaovba)
  • Re: Warning: cannot write logfile
    ... And what version of SQL Server? ... If the account is not a sysadmin, then the SQL Agent Proxy account will be ... I am scheduling a simple job to run a query. ...
    (microsoft.public.sqlserver.mseq)
  • Re: Help with Cartesian or cross joins
    ... in your SQL on the basis that it grossly clutters the SQL and requires you to keep editing it whenever the set of numbers changes. ... More maintainable is putting those numbers into a Table (or computing them via a Query), so you can leave all your SQL alone once you have it working. ... And we have the Table of existing, and thus unavailable, account numbers at each Branch. ... This Query lists account numbers up to 998 for Branch "01" and up to 997 for Branch "02", omitting the other numbers and Branches. ...
    (microsoft.public.access.queries)
  • Re: Discussing 3 different strategies for deleting from multiple tables
    ... I will be using SQL Server but I am riding on top of a third party OLE DB Provider. ... I will only use 3 tables for brevity - Account, Contact, Opportunity - and assume the following relationship. ... This results in one parameterized query followed by two more trips to the database to delete any orphaned records. ...
    (microsoft.public.data.ado)
  • Re: DBMS and lisp, etc.
    ... Naively implemented with SQL, again for 10 ... (1 query for the initial orders, 1 query for each order for its ... soon as you upgrade to the SQL database. ... (eq (order-customer orderA) ...
    (comp.lang.lisp)