473,513 Members | 2,669 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

BCP error - missing data

After loading the BCP files that are created during the trigger/
reporting events I've noticed that the data in the table is missing
records. I've also noticed that the missing records (records in the
table but not in the BCP out files) seem to occur in contiguous
blocks. Since the complete set of records exists in the table, I
assume this points to an issue in the way the TableUpdate script/
Triggers interact with the system. But i tried to take out the bcp
procedure, do test on trigger, then no data missing, So, I think the
problem is still on bcp part. Could you help me with that?

CREATE TABLE [EventUpdate] (
[id] [int] NOT NULL ,
[eventid] [int] NOT NULL ,
[sequenceid] [int] NOT NULL ,
[UpdatePass] [int] NULL
) ON [PRIMARY]
GO
create trigger trgEventUpdate on EventLog For Insert,Update as
insert into EventUpdate (id,eventid,sequenceid) select ins.id,
ins.eventid,ins.sequenceid from inserted ins

bcp script:

bcp "select a.* from w..eventlog a, w..eventupdate b where
a.eventid=b.eventid and a.sequenceid=b.sequenceid and b.eventid<>-1
and b.sequenceid<>-1 and b.updatepass=1" queryout 30sec-%TFN_NOW%.wrk -
U <userwithaccess-P <password-S doserver -f EventLog.fmt

Thanks in advance for your reply!

Jan 31 '07 #1
3 3915
(da*****@gmail.com) writes:
After loading the BCP files that are created during the trigger/
reporting events I've noticed that the data in the table is missing
records. I've also noticed that the missing records (records in the
table but not in the BCP out files) seem to occur in contiguous
blocks. Since the complete set of records exists in the table, I
assume this points to an issue in the way the TableUpdate script/
Triggers interact with the system. But i tried to take out the bcp
procedure, do test on trigger, then no data missing, So, I think the
problem is still on bcp part. Could you help me with that?
Please, could you take that again, and more slowly this time? Keep in
mind that people reading this newsgroup does not know about your system.

You are missing data but where? You appear to extract data with BCP, do
you load it anywhere else?

One thing I can note:
create trigger trgEventUpdate on EventLog For Insert,Update as
insert into EventUpdate (id,eventid,sequenceid) select ins.id,
ins.eventid,ins.sequenceid from inserted ins

bcp "select a.* from w..eventlog a, w..eventupdate b where
a.eventid=b.eventid and a.sequenceid=b.sequenceid and b.eventid<>-1
and b.sequenceid<>-1 and b.updatepass=1" queryout 30sec-%TFN_NOW%.wrk -
U <userwithaccess-P <password-S doserver -f EventLog.fmt
The BCP query has a condition on the column UpdatePass which is not
set in the trigger. So from what you have posted, I would not expect
anything at all to go in the BCP file.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jan 31 '07 #2
1.
You are missing data but where? You appear to extract data withBCP, do
you load it anywhere else?
On table Eventlog, there are missing data.
2.
create trigger trgEventUpdate on EventLog For Insert,Update as
insert into EventUpdate (id,eventid,sequenceid) select ins.id,
ins.eventid,ins.sequenceid from inserted ins
bcp"select a.* from w..eventlog a, w..eventupdate b where
a.eventid=b.eventid and a.sequenceid=b.sequenceid and b.eventid<>-1
and b.sequenceid<>-1 and b.updatepass=1" queryout 30sec-%TFN_NOW%.wrk -
U <userwithaccess-P <password-S doserver -f EventLog.fmt

TheBCPquery has a condition on the column UpdatePass which is not
set in the trigger. So from what you have posted, I would not expect
anything at all to go in theBCPfile.
sorry, i didn't clearly explain it. i did set the UpdataPass:

CREATE TABLE [EventLogUpdate] (
[id] [int] NOT NULL ,
[eventid] [int] NOT NULL ,
[sequenceid] [int] NOT NULL ,
[UpdatePass] [int] NULL
) ON [PRIMARY]
GO
create trigger trgEventUpdate on EventLog For Insert,Update as
insert into EventLogUpdate (id,eventid,sequenceid) select ins.id,
ins.eventid,ins.sequenceid from inserted ins
GO


Jan 31 '07 #3
(da*****@gmail.com) writes:
On table Eventlog, there are missing data.
But it was the EventLog table you had the trigger on? If data is
missing in EventLog what has the trigger or the BCP stuff to do with it?
sorry, i didn't clearly explain it. i did set the UpdataPass:

CREATE TABLE [EventLogUpdate] (
[id] [int] NOT NULL ,
[eventid] [int] NOT NULL ,
[sequenceid] [int] NOT NULL ,
[UpdatePass] [int] NULL
) ON [PRIMARY]
GO
create trigger trgEventUpdate on EventLog For Insert,Update as
insert into EventLogUpdate (id,eventid,sequenceid) select ins.id,
ins.eventid,ins.sequenceid from inserted ins
GO
I still can't see any update of UpdatePass?

It's your call. If you don't want to explain what you are doing, that
is alright. But unfortunately it is difficult to answer your questions
in this case.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jan 31 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
2477
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
0
6078
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
1
7458
by: Minh | last post by:
I've just installed VS.NET 2003 on my Athlon XP 1800+. However I couldn't get any project with STL includes to compile even if I create a new empty project (and added #include <string>). It gave me...
2
5717
by: Qiao Yun | last post by:
I used vc++.net (visual studio .net ) to open a project which can work well in vc++6.0. I succeeded in compiling the project in vc++.net in release mode . But when I tried to compile the project...
2
3909
by: Nick | last post by:
I'm learning C++ and ran into a compile error using Visual C++ 2005 Express on the following example program (located at http://www.cplusplus.com/doc/tutorial/templates.html): // template...
5
2365
by: rpjanaka | last post by:
Hi all, I am using AJAX to submit a data from a web page, it is properly working on the local host (when test with the local machine it is ok).also when access from another machine the pages are...
9
2933
by: i | last post by:
#include<stdio.h> #include<conio.h> #include<process.h> #include<string.h> char ch; int n,m; void main(); char check(int,int,char); void cash(int,int,char); void debit_card(int,int,char);
1
5022
by: prasadmore | last post by:
I am developing a web service using CDO 1.21 to create an appointement in Exchange Server 2003. The Logon method is executing successfully and able to access Inbox folder. When I try to create an...
0
1454
by: santu07 | last post by:
I am trying to export data from Excel11.0 object to datatable using C#. I can't properly open workbooks. Can anyone please help me to fix this error. I got the above error when i try to open the...
0
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7379
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.