Re: how to create stored proc to read in flat file, parse it, and create records?
hkvats_1999_at_yahoo.com
Date: 06/25/04
- Next message: hkvats_1999_at_yahoo.com: "Re: putting the results of a stored procedure into a cursor... is it possible?"
- Previous message: hkvats_1999_at_yahoo.com: "Re: Transact Max Statement"
- In reply to: NotGiven: "Re: how to create stored proc to read in flat file, parse it, and create records?"
- Messages sorted by: [ date ] [ thread ]
Date: 25 Jun 2004 02:38:04 -0700
you can also use BULK INSERT
following is the example inserting from csv flat file to Order Details
SQL Server Table....
BULK INSERT Northwind.dbo.[Order Details]
FROM 'f:\orders\lineitem.tbl'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = ',\n'
)
regarding bcp.fmt....
you create your own fmt file for BCP Operation you need to specify
this BCP format file, while executing BCP command....
Regards
Hari Sharma
Sr. Consultant Databases....
"NotGiven" <noname@nonegiven.net> wrote in message news:<KCKxc.239$cP5.140@bignews6.bellsouth.net>...
> thanks! Where is bcp.fmt located?
>
>
> "Aaron W. West" <tallpeak@hotmail.NO.SPAM> wrote in message
> news:13mdndRDhbaf9Frd38DK-g@speakeasy.net...
> > look up BULK COPY, the version of BCP you can use from a stored procedure.
> >
> > You might run BCP the first time to generate an initial BCP.FMT file, then
> > edit that file as needed.
> >
> > ---
> >
> > "NotGiven" <noname@nonegiven.net> wrote in message
> > news:tkIxc.12080$LC3.9291@bignews2.bellsouth.net...
> > I am relatively new to sqlserver but I have done this in another database
> > without stored procs.
> >
> > I want to be able to:
> > - read in several flat files that contain 1000's of records with fixed
> > length delimited fields
> > - parse each field
> > - create sqlserver records with parsed records/fields
> >
> > I've written stored procs before but at a loss how to begin on this one.
> > Any help is much appreciated.
> >
> >
> >
- Next message: hkvats_1999_at_yahoo.com: "Re: putting the results of a stored procedure into a cursor... is it possible?"
- Previous message: hkvats_1999_at_yahoo.com: "Re: Transact Max Statement"
- In reply to: NotGiven: "Re: how to create stored proc to read in flat file, parse it, and create records?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|