Solved

BCP and Triggers

Posted on 2002-06-21
3
1,216 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
3 Comments
 

Accepted Solution

by:
sunpatil earned 100 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

840 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