I'm only familiar with NT/Win2k in this area; I don't know what OS security
context xp_cmdshell uses under Win9x.
If you can't find the answer, you can also try a standard security login.
Add a SQL Server standard login, grant access to the database and specify
the login and password (instead of -T) in the BCP command line:
EXEC master..xp_cmdshell 'bcp "SELECT * FROM Northwind..products" queryout
C:\TestData\teststuff.txt -ULoginName -PLoginPassword -c- -SMERLYN'
Hope this helps.
> Thanks Dan,
> I'm a little "green" in the SQL Server area...Can you tell me how to go
> about the task...
> Is it different from a win98/desktop (SQL 7.0) to a Server platform?
> > I assume you are not an SA. In this case, the trusted connection is
> via the
> > SQLAgentCmdExec account. Your command will work fine if you add the
> > SQLAgentCmdExec account login to the SQL Server and database.
> > Hope this helps.
> > > Hi,
> > > I'm trying to get the hang of BCP and as a trail, I've executed the
> > > basic command (from my desktop - SQL 7.0) .... of which I keep
> > > the error below:
> > > Any ideas what I am doing wrong...? Is there a simplier way to copy
> > > to a text file?
> > > Thanks
> > > TwoPlusTwo
> > > EXEC master..xp_cmdshell 'bcp "SELECT * FROM Northwind..products"
> > > queryout C:\TestData\teststuff.txt -T -c -SMERLYN'
> > > SQLState = 37000, NativeError = 18452
> > > Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed
> > > user '(null)'. Reason: Not associated with a trusted SQL Server
> > > connection.
> > > (2 row(s) affected)
> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.
> Sent via Deja.com http://www.deja.com/
> Before you buy.