February 3, 2009 at 9:38 am
I am just learning about Batch file execution for some of my other work, and was hoping I would be able to implement a batch file to execute multiple queries in sequence.
If this is true, could someone provide an example of what calling a query from a batch file would look like? If it matters, I am using SQL Server 2005 on a Windows Vista machine.
Thanks!
February 3, 2009 at 9:40 am
What you may want to read up on is Service Broker. Other than that, I can't provide much more assistance at this time.
February 3, 2009 at 10:56 am
From your suggestion, I read through some of the Intro to Service Broker at: http://msdn.microsoft.com/en-us/library/ms345108.aspx
Maybe I didn't describe what I was looking for well enough, because it seems a lot more complicated than what I need.
I have about 5 queries that I run in sequence every morning to update various tables, so instead of having to open up the Server Management Studio, and run each individually, I was hoping to be able to create a batch file which could iterate through them and run them each one at a time.
Thanks!
February 3, 2009 at 1:32 pm
Why not create it as a Scheduled Job?
-Roy
February 3, 2009 at 1:52 pm
If it is the same queries in the same order every day, I'd now have to agree with Roy; a scheduled job with multiple steps.
February 3, 2009 at 3:01 pm
Thanks. I was able to schedule a job... though I'm surprised there's no way to run this sort of thing without opening the SQL Server Management Studio.
... or am I missing something still?
Thanks again!
February 3, 2009 at 3:08 pm
What do you want to trigger the job? does it only run once a day?
February 4, 2009 at 11:49 am
I have a couple imports that I do from a remote database, after which I update my own database with the calculations and manipulations on this new data.
I have the imports set up using the SSIS, so I only have to change the date and double click to run those.
Then I run all the update queries.
I'd like to make it as easy as possible to run every weekday morning when I plug my laptop in at work.
Thanks again!
February 4, 2009 at 11:53 am
Why not add the updates to your SSIS package?
February 4, 2009 at 12:04 pm
Sorry for being such a newbie about this, but do you know a good resource on SSIS packages to help guide me through the process of adding these queries?
I only have the SSIS packages for the import procedure because I used the import/export wizard and right before execution clicked the "Save SSIS Package"...
So I don't really know much about them...
Thanks!
February 4, 2009 at 12:31 pm
This is the book I first purchased when i started working with SSIS, and my partner picked it up also:
Professional SQL Server 2005 Integration Services by Wrox.
I keep it with me in my portable library (in my car, so I have it at home or work).
February 4, 2009 at 1:43 pm
Thanks!
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply