dbTalk Databases Forums  

BCP Error

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss BCP Error in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Lianne Kwock
 
Posts: n/a

Default BCP Error - 04-17-2006 , 06:27 PM






Hi,

I got this error when I was trying to run BCP from DOS command.

SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]Unable to open BCP host data-file

The following is my code. I got results from by running the query alone.

--sp_spaceused docphrase

DECLARE @strsql varchar(500), @str varchar(500)

DECLARE @x int, @y int

SET @x=907745897

SET @y=907745901

SET @strsql = '"select * FROM FAST_INT_0005.dbo.DocPhrase (nolock) where
docPhraseid > ' + converT(varchar,@x) + ' AND docphraseId < ' +
converT(varchar,@y ) + '"'

SET @str = 'bcp '+ @strsql + ' queryout -oC:\BigInt\doc_1.txt -SQAIMGSQL01
-T'


PRINT @str

EXEC master..xp_cmdshell @str


I appreciate if anyone could help me with this issue.


Thanks,
Lianne

Reply With Quote
  #2  
Old   
Enric
 
Posts: n/a

Default RE: BCP Error - 04-18-2006 , 05:05 AM






Please find attached examples, tested myself successfully...

--BCP hell.....
C:\>bcp abs.abs_diario in c:\20050929.dat -n -Ssql2\inst01 -Uusrdts -Pdts
C:\>bcp ABS_Diario_Dat in Diariomes10.dat -c -U ABS -P -S SQL1
C:\OFI0501>BCP abs.dbo.ABS_OF501 IN 20050726.DAT -e enric.txt -C -c
-Ssql2\inst01 -Uusrdts -Pdts

--
Please post DDL, DCL and DML statements as well as any error message in
order to understand better your request. It''''s hard to provide information
without seeing the code. location: Alicante (ES)


"Lianne Kwock" wrote:

Quote:
Hi,

I got this error when I was trying to run BCP from DOS command.

SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]Unable to open BCP host data-file

The following is my code. I got results from by running the query alone.

--sp_spaceused docphrase

DECLARE @strsql varchar(500), @str varchar(500)

DECLARE @x int, @y int

SET @x=907745897

SET @y=907745901

SET @strsql = '"select * FROM FAST_INT_0005.dbo.DocPhrase (nolock) where
docPhraseid > ' + converT(varchar,@x) + ' AND docphraseId < ' +
converT(varchar,@y ) + '"'

SET @str = 'bcp '+ @strsql + ' queryout -oC:\BigInt\doc_1.txt -SQAIMGSQL01
-T'


PRINT @str

EXEC master..xp_cmdshell @str


I appreciate if anyone could help me with this issue.


Thanks,
Lianne

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.