Re: Failed to load all the records if any one of the records is in
- From: "Arnie Rowland" <arnie@xxxxxxxx>
- Date: Thu, 21 Sep 2006 10:16:18 -0700
Normally, operations such as this are best done by first loading into a
'Staging' table, them checking that data for abnormalities and correcting it
if possible, separating out the failures, and then inserting only the
'cleansed' data into the production tables.
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Veeru" <Veeru@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:780BD136-11F9-4F7E-BDE0-CF35DA64CD26@xxxxxxxxxxxxxxxx
Hi Erland Sommarskog
Lets assume that Customer_type is of length 4 in the database table.
If we try to load the records having the customer_type more than 4
charecters, we get an error, at the same time remaining records in the
data
file are valid but these are not loading into database.
My intensition is to load all the valid records into the table and reject
all invalid records. My data file contains combination of valid and
invalid
records.
Can you suggest me any solution.
Regards
Veeru
"Erland Sommarskog" wrote:
Veeru (Veeru@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
I am trying to load the 30 records into the database table. I have
created one Format File and one .sql file to load the data. I observed
one problem during loading the data into table, if there is any problem
in the first record of my 30 records, the sqlcmd is rejecting the
entire
datafile (30 records are in this file) instead of rejecting that record
and going to load the next record.
What sort of error do you get?
You could try the ROWS_PER_BATCH option and set it to 1, but that may
not help depending on the issue.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- Re: Failed to load all the records if any one of the records is invali
- From: Erland Sommarskog
- Re: Failed to load all the records if any one of the records is invali
- Prev by Date: Re: Enterprise Manager
- Next by Date: How do I net send a job notification to multiple operators?
- Previous by thread: Re: Failed to load all the records if any one of the records is invali
- Next by thread: Re: Failed to load all the records if any one of the records is in
- Index(es):
Relevant Pages
|