?
Solved

When trigger is enabled, no records will insert via a dtsx job.

Posted on 2012-03-14
4
Medium Priority
?
257 Views
Last Modified: 2012-03-14
I have a table and trigger that is a duplicate in the design of another table in a different database.

While the table in the other database successfully allows the records to be inserted, and completes the trigger instruction, the one I am having trouble with, does not.

First I ran the Script 'Create  To' for the table and then the trigger.  I then changed the database reference and ran each script.  Next I performed the same duplication , but re-pointing the variables and database target.

When I ran the SSIS job, it showed the correct number of reads from the source file, but ended up stating that 0 records were written.

When I disabled the trigger, and reran the SSIS job, it had 100% of the read records written to the table.

I have looked numerous times and have not seen a single reason why the trigger should not work.  I have rebuilt it dozens of times.
0
Comment
Question by:itatahh
[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
4 Comments
 
LVL 15

Accepted Solution

by:
Anuj earned 2000 total points
ID: 37720315
SSIS works on Bulk Insert, for bulk inserts triggers will not fire, you have to enable Fire trigger option in ssis package.
0
 

Author Comment

by:itatahh
ID: 37720637
anujnb,

Good suggestion.  I have made the change to this but I am still having a problem.

When the trigger is disabled, the data inserts just fine.

When the trigger is enabled, I now do not get zero records written into the intended table (not the table that the trigger copies the record to), but instead, the SSIS package fails.

So, all of the data arrives at the OLEDB destination correctly when the trigger is disabled.  Previously, no data arrived when the trigger was enabled, but I received no error, when the trigger is enabled.  Now it not only does not deliver any data, but the SSIS package gives me an error.

Attached is the output message showing the error.

I will begin looking up the error, to determine what it means, but if you, or anyone else, happens to see what it is, I would appreciate it.

Thanks,
0
 

Author Comment

by:itatahh
ID: 37720719
anujnb,

Credit goes to you for reminding me about the FIRE_TRIGGERS.

It ends up that while I was working on getting the trigger to work, I made a change to the destination table that I had not made also to the table the trigger was going to copy data to, after doing some checks.

So, now that I have the one field thee same length on both tables, it is working.

Thanks,
0
 

Author Closing Comment

by:itatahh
ID: 37720731
Oh the simple things we sometimes forget.  Thankfully, there are enough around, at experts-exchange, that can point out what we missed - and without making us feel bad.  

Thanks!  :-)
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

743 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