Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trigger doesn't fire on BCP

Status
Not open for further replies.

TheJFM

Programmer
Jun 13, 2002
65
GB
Hi

I have an after insert trigger on a table.

It fires on a table to table insert.

However an insert by bcp from a sysbase server fails to fire the trigger.

Any ideas people?

** Don't reach for the moon when you have the stars. ;-) TheJFM **
 
This is normal default behaviour for bulk copy operations (bcp, BULK INSERT). You need to specify you want to fire the insert triggers using the -h flag in your bcp statement:

Code:
-h"FIRE_TRIGGERS"

--James
 
Thanks James

Unfortunately our Sybase deveoper on Unix has informed me that their BCP does not support hints.

Any othjer ideas?

Thanks

** Don't reach for the moon when you have the stars. ;-) TheJFM **
 
Sorry, I don't use Sybase so I don't know what its version of bcp is capable of. If your developer doesn't think you can specify to fire triggers then you may need to rethink your data transfer.

Can you use bcp from your SQL Server end and grab the data from Sybase?

Or you could get the data into a holding table and then simply INSERT it into your main table - which will fire the triggers as normal.

--James
 
Thanks

The problem is that the data comes into Sybase on an adhoc basis. When it arrives the Sybase guys push it to us.

I want our trigger to fire when and if the data arrives. I really didn't want to give the access to run an sp on our servers but I may have no choice.

** Don't reach for the moon when you have the stars. ;-) TheJFM **
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top