Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

35 Posts

Posted - 04/06/2013 :  23:53:33  Show Profile  Reply with Quote

I am fairly new to using triggers. I have a straightforward question. I have a staging table that gets loaded every day by deleting everything in there first then reloading the data from the source file. I would like to create a trigger that insert only certain accounts to table2. I created an trigger with insert after option but I get lots of duplicate records in table2. Can someone please assist here?


James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 04/07/2013 :  21:00:30  Show Profile  Reply with Quote
Since the problem appears to be in the logic of your trigger code, if you can post the code that you are using that would enable someone to suggest solutions.

When I need to load data from a staging table to the production table, I don't use triggers. I set up another job/query that picks up the rows from the staging table and inserts/updates/deletes as required from the production table. Usually it is best to reserve triggers for light-duty tasks, and only when required (for example auditing).
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000