|
-
March 6th, 2006, 05:32 PM
#1
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.
-
March 7th, 2006, 04:03 AM
#2
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|