Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

BCP error -Unable to open BCP host data-file Expand / Collapse
Author
Message
Posted Friday, June 18, 2010 5:06 PM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Sunday, April 13, 2014 9:51 PM
Points: 4,570, Visits: 8,315
When you run bcp on your local machine C:\ is your local drive.
When you run bcp on the server C:\ is a local drive on he server.

Compare:
"dir C:\" from command prompt and
exec master.dbo.xp_cmdshell 'dir c:\'
Post #939896
Posted Friday, June 18, 2010 10:05 PM


SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, February 11, 2014 9:39 PM
Points: 30, Visits: 58
Thanks Sergiy for the reply..

Sql Server resides in the machine where im executing xp_cmdshell
in that case my local machine and server are the same..

all other commands works fine with xp_cmdshell.. only bcp throws an error ..

So i don't think that is the problem. Any way I have tried Wat u have told

Here are the results and they are Identical

-- Through xp_cmdshell

Volume in drive C has no label.
Volume Serial Number is 402B-0039
NULL
Directory of c:\
NULL
06/15/2010 10:54 AM 17,408 1.xls
04/14/2010 05:23 PM <DIR> 80613812935150ba72
04/14/2010 03:27 PM 0 AUTOEXEC.BAT
05/12/2010 04:55 PM 1,652 bar.emf
05/07/2010 06:14 PM <DIR> bujji
05/19/2010 12:48 PM <DIR> BUJJI_RD
04/14/2010 03:27 PM 0 CONFIG.SYS
06/14/2010 10:44 AM <DIR> db
06/07/2010 02:39 PM <DIR> Documents and Settings
02/19/2010 03:55 PM 8,327,264 Firefox Setup 3.6.exe
06/03/2010 10:27 AM <DIR> Inetpub
04/14/2010 05:14 PM 244 Install.log
04/14/2010 05:10 PM <DIR> Intel
06/17/2010 06:21 PM <DIR> Lijo
06/18/2010 10:40 AM 12 lijo.txt
04/19/2010 01:25 PM <DIR> MSDE_Database
06/02/2010 06:22 PM <DIR> MSVisualStudio6.00
06/09/2010 11:48 AM <DIR> oboutSuite
06/18/2010 06:12 PM <DIR> Official
06/18/2010 04:12 PM <DIR> Program Files
04/14/2010 05:12 PM 1,769 RHDSetup.log
06/19/2010 09:27 AM 970 service.log
05/05/2010 06:18 PM <DIR> Softwares
05/25/2010 03:05 PM <DIR> Stanley
05/25/2010 03:07 PM 160,178,714 Stanley.zip
04/02/2010 02:30 PM 15,944,192 TA.bak
06/14/2010 10:38 AM 28,521 test.jpg
06/15/2010 10:54 AM 17,408 Test.xls
06/15/2010 10:49 AM 8,281 Test.xlsx
04/23/2010 11:39 AM <DIR> SAmple
06/18/2010 10:31 AM <DIR> WINDOWS
06/17/2010 06:14 PM <DIR> WindowsApplication1
05/18/2010 01:08 PM <DIR> working folder
14 File(s) 184,526,435 bytes
19 Dir(s) 81,251,590,144 bytes free


-- Through Cmd prompt

Volume in drive C has no label.
Volume Serial Number is 402B-0039

Directory of c:\

06/15/2010 10:54 AM 17,408 1.xls
04/14/2010 05:23 PM <DIR> 80613812935150ba72
04/14/2010 03:27 PM 0 AUTOEXEC.BAT
05/12/2010 04:55 PM 1,652 bar.emf
05/07/2010 06:14 PM <DIR> bujji
05/19/2010 12:48 PM <DIR> BUJJI_RD
04/14/2010 03:27 PM 0 CONFIG.SYS
06/14/2010 10:44 AM <DIR> db
06/07/2010 02:39 PM <DIR> Documents and Settings
02/19/2010 03:55 PM 8,327,264 Firefox Setup 3.6.exe
06/03/2010 10:27 AM <DIR> Inetpub
04/14/2010 05:14 PM 244 Install.log
04/14/2010 05:10 PM <DIR> Intel
06/17/2010 06:21 PM <DIR> Lijo
06/18/2010 10:40 AM 12 lijo.txt
04/19/2010 01:25 PM <DIR> MSDE_Database
06/02/2010 06:22 PM <DIR> MSVisualStudio6.00
06/09/2010 11:48 AM <DIR> oboutSuite
06/18/2010 06:12 PM <DIR> Official
06/18/2010 04:12 PM <DIR> Program Files
04/14/2010 05:12 PM 1,769 RHDSetup.log
06/19/2010 09:22 AM 145 service.log
05/05/2010 06:18 PM <DIR> Softwares
05/25/2010 03:05 PM <DIR> Stanley
05/25/2010 03:07 PM 160,178,714 Stanley.zip
04/02/2010 02:30 PM 15,944,192 TA.bak
06/14/2010 10:38 AM 28,521 test.jpg
06/15/2010 10:54 AM 17,408 Test.xls
06/15/2010 10:49 AM 8,281 Test.xlsx
04/23/2010 11:39 AM <DIR> SAmple
06/18/2010 10:31 AM <DIR> WINDOWS
06/17/2010 06:14 PM <DIR> WindowsApplication1
05/18/2010 01:08 PM <DIR> working folder
14 File(s) 184,525,610 bytes
19 Dir(s) 81,251,434,496 bytes free

--Regards
Alban Lijo


-- Alban Lijo <SQL Rookie>
Post #939924
Posted Monday, January 07, 2013 12:50 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, January 07, 2013 12:45 AM
Points: 1, Visits: 14
Thank you. It was the wrong directory.
Post #1403439
Posted Thursday, March 21, 2013 11:07 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 12:53 PM
Points: 7, Visits: 54
Hi everyone,
I have this error output in SSMS for the following query
exec Master..xp_cmdshell 'bcp "select blobdata from SynDocs.dbo.BLOBDATA where blobid = 2" queryout "c:\filename2.img" -S ROK-W7STHONUK-7 -T'

The output is 2 rows
NULL
Enter the file storage type of field blobdata [image]:

when i run the same query thru cmd prompt, the result is
SQLState = S1000, NativeError = 0
Error = [Microsoft][SQL Native Client]Unable to open BCP host data-file.

any of you help me with this please.

Post #1433918
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse