Re: bcp data export from SQL Server to file
From: Dan Guzman (danguzman_at_nospam-earthlink.net)
Date: 05/03/04
- Next message: Dan Guzman: "Re: rule is sql server"
- Previous message: Uri Dimant: "Re: cross-tabulation"
- In reply to: Nikolai Todorov: "Re: bcp data export from SQL Server to file"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 3 May 2004 08:04:06 -0500
If you are using xp_cmdshell, the OS security context will be the SQL Server
service account when executed by a sysadmin server role member. When
executed by a non-sysadmin user, the security context will be the SQL Server
Agent proxy account. The proxy account can be configured from Enterprise
Manager under the SQL Server Agent properties Job System tab when the 'only
allow users with sysadmin privileges...' box is unchecked'.
If you continue to have problems, please post the relevant code.
-- Hope this helps. Dan Guzman SQL Server MVP "Nikolai Todorov" <nikolai.todorov@smcon.com> wrote in message news:%23rDB6uQMEHA.3052@TK2MSFTNGP12.phx.gbl... > Yes, and this works just fine. > > But my point is to do it threw my .NET application > The same command generated by my application, when I paste it in the command > prompt it succeeds. But when I execute it threw the application - nothing > hapens. > > So my problem is not that my command doesn't execute, but that it doesn't > execute threw a VS.NET applicaton, using ADO.NET components. > > My suggestion is that I have a permission problems, but I don't know where > they could be. > > "Uri Dimant" <urid@iscar.co.il> wrote in message > news:eWBuQLQMEHA.1340@TK2MSFTNGP12.phx.gbl... > > Nikolai > > create table ww > > ( > > col1 int, > > col2 varchar(50), > > col3 varchar (50) > > ) > > > > insert into ww values (47,'ReadyShip','(503)888-999') > > insert into ww values (48,'MyShipper','(503)1212-454') > > insert into ww values (49,'ReadyShip','(45)888-999') > > insert into ww values (50,'MyShipper','(545)1212-454') > > > > exec master..xp_cmdshell 'BCP northwind..ww IN > > d:\test1.txt -c -C850 -SServer -Usa -Ppass' > > > > > > > > > > "Nikolai Todorov" <nikolai.todorov@smcon.com> wrote in message > > news:uMeM8EQMEHA.3668@TK2MSFTNGP11.phx.gbl... > > > I have not tried a stored procedure, because I think that the reason is > > > somewhere in the permissions wich the .NET application, the export > > > directory, or sql server account has. But I can't find what exactly is. > I > > > suppose the stored procedure should pass the same way the sqlcommand do. > > > > > > > > > "Uri Dimant" <urid@iscar.co.il> wrote in message > > > news:ekK5G7PMEHA.1900@TK2MSFTNGP10.phx.gbl... > > > > Nikolai > > > > Have you tried to wrap the BCP coomand with stored procedure and then > > just > > > > call it from .NET application? > > > > > > > > > > > > > > > > "Nikolai Todorov" <nikolai.todorov@smcon.com> wrote in message > > > > news:eraMd4PMEHA.3348@TK2MSFTNGP09.phx.gbl... > > > > > I have a bcp command which exports a SQL table to a file in a > > directory. > > > > > When I start the command from the command prompt it works just fine. > > > > > But when I try to start it threw a .NET application using a > SqlCommand > > > > > object with a parameter the string of the bcp command - nothing > > happens! > > > > The > > > > > ExecuteNonQuery() method returns -1. > > > > > Where can be the problem, regarding that the SQL Server is not on my > > > > > machine. > > > > > > > > > > Thank you in advance > > > > > > > > > > -- > > > > > Nikolai Todorov > > > > > > > > > > Software Engineer > > > > > SM Consulta Ltd. > > > > > 86, Cherni Vrah Blvd., Office #1 > > > > > Sofia 1407 > > > > > Bulgaria > > > > > Phone: +359 2 9621905 > > > > > +359 2 9625261 > > > > > FAX: +359 2 9624764 > > > > > Mobile: +359 88 8855802 > > > > > http://www.smcon.com > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
- Next message: Dan Guzman: "Re: rule is sql server"
- Previous message: Uri Dimant: "Re: cross-tabulation"
- In reply to: Nikolai Todorov: "Re: bcp data export from SQL Server to file"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading