Re: Bulk Insert Question
From: sqlnewbie (1_at_1.com)
Date: 02/25/05
- Next message: Russell Fields: "Re: Bulk Insert Question"
- Previous message: === Steve L ===: "Re: SQL Server 2005 Beta 2 installation"
- In reply to: Hugo Kornelis: "Re: Bulk Insert Question"
- Next in thread: Russell Fields: "Re: Bulk Insert Question"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 25 Feb 2005 16:53:06 -0500
thanks, I'll play around with it...
"Hugo Kornelis" <hugo@pe_NO_rFact.in_SPAM_fo> wrote in message
news:g77v11dgleakllnsplfl2aacookufkbcum@4ax.com...
> 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: Russell Fields: "Re: Bulk Insert Question"
- Previous message: === Steve L ===: "Re: SQL Server 2005 Beta 2 installation"
- In reply to: Hugo Kornelis: "Re: Bulk Insert Question"
- Next in thread: Russell Fields: "Re: Bulk Insert Question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|