Google Groups Home
Help | Sign in
Question regarding bcp
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
neerajrathi2 via DBMonster.com  
View profile
 More options Jul 9, 7:32 am
Newsgroups: comp.databases.sybase
From: "neerajrathi2 via DBMonster.com" <u37674@uwe>
Date: Wed, 09 Jul 2008 11:32:09 GMT
Local: Wed, Jul 9 2008 7:32 am
Subject: Question regarding bcp
Hello,
We use bcp to populate data in tables. Tables have partition for each week.
Problem is sometime by error we get Future's data. So while bcp throws error
that
"one or more Rows do not belong to any partitions" and then it aborts bcp
command.
because of none of records in file get loaded.

My question is there any way to stop this so that bcp will ignore that record
but process other records.
I tired -m option of bcp but got same result.

Thanks in advance.

--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums.aspx/sybase/200807/1


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Manish Negandhi  
View profile
 More options Jul 10, 9:17 am
Newsgroups: comp.databases.sybase
From: Manish Negandhi <negandhi.man...@gmail.com>
Date: Thu, 10 Jul 2008 06:17:35 -0700 (PDT)
Local: Thurs, Jul 10 2008 9:17 am
Subject: Re: Question regarding bcp
On Jul 9, 4:32 pm, "neerajrathi2 via DBMonster.com" <u37674@uwe>
wrote:

> Hello,
> We use bcp to populate data in tables. Tables have partition for each week.
> Problem is sometime by error we get Future's data. So while bcp throws error
> that
> "one or more Rows do not belong to any partitions" and then it aborts bcp
> command.
> because of none of records in file get loaded.

> My question is there any way to stop this so that bcp will ignore that record
> but process other records.
> I tired -m option of bcp but got same result.

What version of ASE are you using ? can you post the exact error
message with message number ?

Manish Negandhi
[TeamSybase]


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
SybaseNeal  
View profile
 More options Jul 10, 1:18 pm
Newsgroups: comp.databases.sybase
From: SybaseNeal <nstac...@gmail.com>
Date: Thu, 10 Jul 2008 10:18:52 -0700 (PDT)
Local: Thurs, Jul 10 2008 1:18 pm
Subject: Re: Question regarding bcp
Hello,

Bcp works by sending rows to the server in batches (for performance
reasons).
If one row fails in a batch, than the entire batch fails.  So if you
set your batch
size to one you should be able to copy in all of the rows that belong
in partitions:

% bcp pubs2..segtest in test.dat -Usa -P -c -b1

Starting copy...
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Server Message: NSTACKSUN - Msg 4851, Level 16, State 2:
BULK COPY IN failed. One or more rows do not belong to any partition
of table 'segtest'.

Server Message: NSTACKSUN - Msg 3621, Level 10, State 0:
Command has been aborted.

Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
bcp copy in partially failed

23 rows copied.

Setting the batch size to 1 causes Adaptive Server to allocate one
data page to one row copied in. This option only applies to fast bcp,
and is only useful in locating corrupt rows of data. Use -b1 with care
— doing so causes a new page to be allocated for each row, and is a
poor use of space.

Thanks,
  Neal


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bret_Halford  
View profile
 More options Jul 14, 1:07 pm
Newsgroups: comp.databases.sybase
From: Bret_Halford <b...@sybase.com>
Date: Mon, 14 Jul 2008 10:07:46 -0700 (PDT)
Local: Mon, Jul 14 2008 1:07 pm
Subject: Re: Question regarding bcp
On Jul 9, 5:32 am, "neerajrathi2 via DBMonster.com" <u37674@uwe>
wrote:

> Hello,
> We use bcp to populate data in tables. Tables have partition for each week.
> Problem is sometime by error we get Future's data. So while bcp throws error
> that
> "one or more Rows do not belong to any partitions" and then it aborts bcp
> command.
> because of none of records in file get loaded.

> My question is there any way to stop this so that bcp will ignore that record
> but process other records.
> I tired -m option of bcp but got same result.

> Thanks in advance.

Have you considered adding a partition for future data so the data has
a place to go?
You could run a job after the bcp to delete that data.

-bret


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google