"Chuck Lathrope" <chuck@soarsolutions-dot.com> wrote in message
news:Ok%23wxaBeFHA.2584@tk2msftngp13.phx.gbl...
> This did the trick. Now how am I going to automate this? Any ideas?
>
> Thanks,
> Chuck
>
> "Ami Levin" <XXX__NO_SPAM__XXX__Levin_Ami@Yahoo.com> wrote in message
> news:%23oSrFb8dFHA.3488@tk2msftngp13.phx.gbl...
>> Hi Chuck,
>>
>> I remember encountering this error message when there was a missing
>> <CR><LF> at the end of the format file.
>> Just open the format file with any text editor and add <enter> at the end
>> of the last line.
>>
>> HTH
>>
>>
>> "Chuck Lathrope" <chuck@soarsolutions-dot.com> wrote in message
>> news:O7GZZK7dFHA.2736@TK2MSFTNGP12.phx.gbl...
>>>I am trying to import 2 columns from a 3 column file, but I get:
>>> C:\temp\>bcp soar.dbo.remarks_temp in remarks.txt -f bcp.fmt
>>> SQLState = S1000, NativeError = 0
>>> Error = [Microsoft][ODBC SQL Server Driver]I/O error while reading BCP
>>> format file
>>>
>>> Here is the template file:
>>> 8.0
>>> 3
>>> 1 SQLCHAR 0 20 "|" 1
>>> SLN SQL_Latin1_General_CP1_CI_AS
>>> 2 SQLCHAR 0 0 "|" 0
>>> dontwant SQL_Latin1_General_CP1_CI_AS
>>> 3 SQLCHAR 0 7000 "\r\n" 2
>>> Remarks SQL_Latin1_General_CP1_CI_AS
>>>
>>> Txt import file sample:
>>>
>>> 12344556|2|Whole lot of text here
>>> 12344557|1|Whole lot of text here 2
>>>
>>> Destination table:
>>>
>>> CREATE TABLE [dbo].[Remarks_Temp] (
>>> [SLN] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
>>> [Remarks] [varchar] (7000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
>>> ) ON [PRIMARY]
>>> GO
>>>
>>> The second column in the text file is what I want to ignore.
>>>
>>> I have looked at
>>>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_impt_bcp_57qd.asp
>>> many many times, but there example is too convenient, I don't have
>>> ability to modify the source text file to move the uneeded columns at
>>> the end of the row.
>>>
>>> Thanks,
>>> Chuck
>>>
>>>
>>>
>>
>>
>
>