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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trigger Trouble

Status
Not open for further replies.

Glowworm27

Programmer
May 30, 2003
587
US
Hello all,

I have A trigger that keeps track of new customers as they are added to the Customers Table.

At one time we used to import customers from a text file , line by line, and this was taking Way to long. but the trigger was working fine.

Recently I changed the way the text file is imported, and I now use a DTS package to import the customers. Now the trigger is not firing to keep track of the new customers.

IS this something that just happens because the way DTS works, or is there a setting in the DTS Data Pump that must be addressed?

George Oakes
Check out this awsome .Net Resource!
 
Check the trigger. It may be written to not fire, if more than one record was inserted. DTS doesn't write the records one at a time, it does them in batches.

Denny

--Anything is possible. All it takes is a little research. (Me)
 
In my DTS Package I have a DataPump Task that Imports customers into the customers table, I also have a table called NewCustID. If a New Customer Record would be created, I want that ID to go into the NewCustID table.
The SQL in the DataPump determines if a new record would be created, otherwise the customer already exists in the database, and nothing should happen

Here is my trigger,

Code:
CREATE TRIGGER trgICustomer ON [Customers] 
FOR INSERT
AS

Insert into NewCustID(CustomerID)
Select ID From Inserted

George Oakes
Check out this awsome .Net Resource!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top