September 27, 2005 at 4:10 pm
HI,
My problem is a little different. I had this "Force Protocol Enable" checked. after that, the BCP "Query out" seems to be failing. But BCP "OUT" works. I tried on my local server, but the reverse happens irrespective of the option in "Force protocol enable". Meaning, "Query out" works and "out" fails with an error :
SQLState = 37000, NativeError = 4060
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database requested in login 'select * from pubs'. Login fails.
NULL
I am running:
Master.dbo.xp_cmdshell 'BCP "select * from pubs..AUTHORS" OUT G:\BCPTEST2.TXT -C RAW -c -T -S Server'
I am not sure if its is because of this but dont know the exact cause. This is a bit urgent and any help in this regards is appreciated. thanks so much...
September 28, 2005 at 1:27 am
Try:-
Master.dbo.xp_cmdshell 'BCP "select * from pubs..AUTHORS" QUERYOUT G:\BCPTEST2.TXT -C RAW -c -T -S Server'
September 28, 2005 at 1:09 pm
Hey thanks Ian. I got the answer. The correct thing for OUT is:
Master.dbo.xp_cmdshell 'BCP "Pubs.dbo.AUTHORS" OUT G:\BCPTEST2.TXT -C RAW -c -T -S Server'
Because, when I am using a query I should use queryout, dumb though!
But, the original problem is still there. that, in spite of giving the query and saying Query out, it is failing. any ideas on that? Actually, this line is a part of a job and the job is failing at this BCP step. But when OUT is used with the above syntax, data is correctly BCPed out. But the thought that, why is this not working with QueryOUT is driving me crazy. Is it really related to Force Protocol Encryption, or it is just a coincidence???
Please help... Thanks.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply