Discussion:
insert trigger not executing
(too old to reply)
mcnewsxp
2012-11-10 13:22:43 UTC
Permalink
i created a an insert trigger that i expect to run during an import to an existing table from a spreadsheet. the trigger complied ok and the sql code within the trigger will run ok. what's the problem?

USE Stellar_PROD;
GO
IF OBJECT_ID ('dbo.ust_userid', 'TR') IS NOT NULL
DROP TRIGGER dbo.ust_userid;
GO
CREATE TRIGGER ust_userid
ON dbo.therapists
AFTER INSERT
AS
update therapists
set the_username = the_FirstName + left(the_LastName,1),
the_password = 'therapy'
GO
Bob Barrows
2012-11-10 13:29:46 UTC
Permalink
Post by mcnewsxp
i created a an insert trigger that i expect to run during an import
to an existing table from a spreadsheet. the trigger complied ok and
the sql code within the trigger will run ok. what's the problem?
I don't know ... what's the symptom? How can the symptom be reproduced? How
is the import being accomplished?

The only thing that occurs to me is that if an SSIS package is being used,
there is a setting in the Destination to allow triggers to fire. Could that
be your problem?
mcnewsxp
2012-11-10 15:06:32 UTC
Permalink
Post by Bob Barrows
Post by mcnewsxp
i created a an insert trigger that i expect to run during an import
to an existing table from a spreadsheet. the trigger complied ok and
the sql code within the trigger will run ok. what's the problem?
I don't know ... what's the symptom? How can the symptom be reproduced? How
is the import being accomplished?
The only thing that occurs to me is that if an SSIS package is being used,
there is a setting in the Destination to allow triggers to fire. Could that
be your problem?
i think you are correct. where is this setting?
Bob Barrows
2012-11-10 15:09:03 UTC
Permalink
Post by mcnewsxp
Post by Bob Barrows
Post by mcnewsxp
i created a an insert trigger that i expect to run during an import
to an existing table from a spreadsheet. the trigger complied ok and
the sql code within the trigger will run ok. what's the problem?
I don't know ... what's the symptom? How can the symptom be
reproduced? How
is the import being accomplished?
The only thing that occurs to me is that if an SSIS package is being used,
there is a setting in the Destination to allow triggers to fire. Could that
be your problem?
i think you are correct. where is this setting?
I don't have a machine with ssis installed handy, so google for
ssis allow triggers to fire
mcnewsxp
2012-11-10 15:20:09 UTC
Permalink
Post by Bob Barrows
Post by mcnewsxp
Post by Bob Barrows
Post by mcnewsxp
i created a an insert trigger that i expect to run during an import
to an existing table from a spreadsheet. the trigger complied ok
and
the sql code within the trigger will run ok. what's the problem?
I don't know ... what's the symptom? How can the symptom be
reproduced? How
is the import being accomplished?
The only thing that occurs to me is that if an SSIS package is being
used,
there is a setting in the Destination to allow triggers to fire.
Could that
be your problem?
i think you are correct. where is this setting?
I don't have a machine with ssis installed handy, so google for
ssis allow triggers to fire
i found it.
it's in the properties of the Destination. Custom Properties | AccessMode. I changed it to OpenRowset from OpenRowset using FastMode.
thanks much.
mcnewsxp
2012-11-10 15:27:11 UTC
Permalink
Post by mcnewsxp
Post by Bob Barrows
Post by mcnewsxp
Post by Bob Barrows
Post by mcnewsxp
i created a an insert trigger that i expect to run during an import
to an existing table from a spreadsheet. the trigger complied ok
and
the sql code within the trigger will run ok. what's the problem?
I don't know ... what's the symptom? How can the symptom be
reproduced? How
is the import being accomplished?
The only thing that occurs to me is that if an SSIS package is being
used,
there is a setting in the Destination to allow triggers to fire.
Could that
be your problem?
i think you are correct. where is this setting?
I don't have a machine with ssis installed handy, so google for
ssis allow triggers to fire
i found it.
it's in the properties of the Destination. Custom Properties | AccessMode. I changed it to OpenRowset from OpenRowset using FastMode.
thanks much.
and yes, that did the trick.

Loading...