Re: Bulk Insert Question
From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 02/25/05
- Next message: Patrick: "Re: Want to Call DTS Package...."
- Previous message: James Goodwin: "Re: Proper Application of a Subquery"
- In reply to: sqlnewbie: "Bulk Insert Question"
- Next in thread: sqlnewbie: "Re: Bulk Insert Question"
- Reply: sqlnewbie: "Re: Bulk Insert Question"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 25 Feb 2005 22:50:27 +0100
On Fri, 25 Feb 2005 16:13:13 -0500, sqlnewbie wrote:
>I need to move some data from an ascii file to a database. I want to use
>BULK INSERT. The problem I have is there is no field seperation in the
>ascii file. For example, columns 1-5 constitute a number, 6-28 constitute a
>description, etc. Is there a way to use BULK INSERT without having to put a
>comma or something between each field of data. Below is a small example of
>data :
>
>item description cost retail
>12345thisistheitemdescription00245903599
>
Hi sqlnewbie,
I think you can do this with a formatfile. The easiest way to do this,
is to first run the bcp utility from a DOS prompt, answering all
questions and saving the information in a format file. Then, use a text
editor to check the contents of the format file and tweak it as needed.
Finally, use the FORMATFILE option of the BULK INSERT to specify this
format file for your date import.
Check out the subjects "bcp Utility (overview)" and "Using Format Files"
in Books Online for more information.
Best, Hugo
-- (Remove _NO_ and _SPAM_ to get my e-mail address)
- Next message: Patrick: "Re: Want to Call DTS Package...."
- Previous message: James Goodwin: "Re: Proper Application of a Subquery"
- In reply to: sqlnewbie: "Bulk Insert Question"
- Next in thread: sqlnewbie: "Re: Bulk Insert Question"
- Reply: sqlnewbie: "Re: Bulk Insert Question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|