Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
manouche
Starting Member
2 Posts |
Posted - 2009-05-01 : 18:21:07
|
I am using SQL Server 2005. I am using bcp to do a query and write a file to a folder on the server. Here is the command that I have issued, both from the SQL Management Studio and from the command line. I am using the Administrator account and password, which I have indicated as Administrator/password below:bcp.exe "select TransactionNumber, DateTime from ILLData..History order by TransactionNumber" queryout "e:\dumpfolder\data.txt" -U Administrator -P password -cThe result is:C:\Documents and Settings\Administrator>bcp.exe "select TransactionNumber, DateT ime from ILLData..History order by TransactionNumber" queryout "e:\dumpfolder\data.txt" -U Administrator -P password -c SQLState = 28000, NativeError = 18456 Error = [Microsoft][SQL Native Client][SQL Server]Login failed for user 'Administrator'.I also tried running the bcp statement using the -T switch to do it as a trusted user, but that did not work either. Can someone enlighten me as to what I need to do? |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
manouche
Starting Member
2 Posts |
Posted - 2009-05-01 : 19:27:56
|
When I use the 'sa' user or run bcp with the -T switch, this is the result:C:\Documents and Settings\Administrator>bcp "select TransactionNumber, from ILLData..History order by TransactionNumber" queryout "e:\dumpdir\data.txt" -U sa -P mypasswd -c SQLState = HY000, NativeError = 0 Error = [Microsoft][SQL Native Client]Unable to open BCP host data-file |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2009-05-03 : 23:45:17
|
does e:\dumpdir\data.txt exist? elsasoft.org |
 |
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2009-05-03 : 23:46:06
|
i mean, does the folder exist? elsasoft.org |
 |
|
|
|
|