?
Solved

BCP and Triggers

Posted on 2002-06-21
3
Medium Priority
?
1,258 Views
Last Modified: 2008-03-04
Hello All,
  The Scenario:  Two tables, A and B.  One trigger T, a row inserted into table A will get the trigger T to fire to automatically insert some values into B.  I have no trouble getting the trigger to fire when performing an SQL to insert something into table A.  The problem is with BCP.  Trigger never fired when I loaded data into table A via the BCP utility.  Is this something that Sybase support or am I out of luck?

Also, in Oracle, triggers can be fired after or before a transaction is taken place.  Can I do the same thing in Sybase and how?

Thanks.
0
Comment
Question by:johnchan2000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Accepted Solution

by:
sunpatil earned 400 total points
ID: 7100139
In sybase when u do bcp triggers don't get fired.
In sybase there is no before or after trigger concept.

regards

sunpatil
0
 
LVL 5

Expert Comment

by:amitpagarwal
ID: 7102723
it is actually simple to achieve.

1. bcp in the data into a different table with same schema ( say XY)
2. then insert into the actual table
insert into maintable select * from XY

This will fire the triggers.

Thanks.
0
 
LVL 1

Author Comment

by:johnchan2000
ID: 7104216
sunpatil answered both of my questions and amitpagarwal gave me an idea on how to get around the problem.  Both gave good and acceptable answers.  sunpatil gets the points since he gave the answers first.

Thanks folks.
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Active Directory can easily get cluttered with unused service, user and computer accounts. In this article, I will show you the way I like to implement ADCleanup..
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question