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

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Trigger/Jobs that execute on data import??

Author  Topic 

jun0
Starting Member

32 Posts

Posted - 2013-03-08 : 06:04:49
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

52326 Posts

Posted - 2013-03-08 : 06:22:50
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
   

- Advertisement -