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
Solved

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

Posted on 2012-03-14
4
254 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
  • 3
4 Comments
 
LVL 15

Accepted Solution

by:
Anuj earned 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

828 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