Copying data( in text file) onto a table

Hi,

I have to transfer a text file which have rows in a pattern as shown below:-

00000000234| 0003434343|Michael|Derosal|001020| | | |

"|" is the delimetor the last 3 delimiter's basically specify that last 3 columns are blank.

Which transfer protocol I can use( BCP etc) and how to use it since I have a delimiter "|" seperating each column.

Any help would be greatly appreciated.
[432 byte] By [sudpat] at [2007-11-19 19:20:15]
# 1 Re: Copying data( in text file) onto a table
Since it seams U have SQL Server:

BULK INSERT [ [ 'database_name'.] [ 'owner' ].] { 'table_name' FROM 'data_file'}[ WITH
(
[ BATCHSIZE [ = batch_size ] ]
[ [ , ] CHECK_CONSTRAINTS ]
[ [ , ] CODEPAGE [ = 'ACP' | 'OEM' | 'RAW' | 'code_page' ] ]
[ [ , ] DATAFILETYPE [ =
{ 'char' | 'native'| 'widechar' | 'widenative' } ] ]
[ [ , ] FIELDTERMINATOR [ = 'field_terminator' ] ]
[ [ , ] FIRSTROW[ = first_row ] ]
[ [ , ] FIRE_TRIGGERS ]
[ [ , ] FORMATFILE = 'format_file_path' ]
[ [ , ] KEEPIDENTITY ]
[ [ , ] KEEPNULLS ]
[ [ , ] KILOBYTES_PER_BATCH [ = kilobytes_per_batch ] ]
[ [ , ] LASTROW [ = last_row ] ]
[ [ , ] MAXERRORS [ = max_errors ] ]
[ [ , ] ORDER ( { column [ ASC | DESC ] } [ ,...n ] ) ]
[ [ , ] ROWS_PER_BATCH [ = rows_per_batch ] ] [ [ , ] ROWTERMINATOR [ = 'row_terminator' ] ]
[ [ , ] TABLOCK ]
)
]

See SQL Server Books Online...
Krzemo at 2007-11-9 13:43:20 >