SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Trigger/Jobs that execute on data import??
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jun0
Starting Member

United Kingdom
32 Posts

Posted - 03/08/2013 :  06:04:49  Show Profile  Reply with Quote
Hi, I need to set up some automated transactions in SQL server, and am unsure of how to go about doing what I need to, but I will explain the basis of it here, and hoepfully someone can explain how I would get the system I want put in place....

Basically, I have data that is imported into a database from quite a few other databases at a set time every day, I need to set something up (some kind of trigger or something) that will execute a query (probably need to make this a stored procedure) once all of the data has finished importing (the time it takes to import the data will vary daily, so i'm not sure how the 'trigger' would be aware when an import has finished), once the first query has finished funning after the import, then this needs to trigger a second query, and the second query then triggers a third before all the data has been processed. The whole system kicks off again at the next import...


How can I get this set up, I'm guessing its a mixture of 'triggers' (not sure if thats the right word) and stored procedures, maybe 'jobs'?

Any info/input would be great, thanks guys

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 03/08/2013 :  06:22:50  Show Profile  Reply with Quote
you just require a single job created in sql server agent for all these. Make your current import process as a step inside this job. Add the next consecutive step as your first query, next as second query etc in same sequential order. Now schedule the job according to your convenience and it will get executed each time by starting off import process then executing your queries one after the other in the same order you set it up.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.03 seconds. Powered By: Snitz Forums 2000