Batch file/Integration services help

  • Probably an easy one:  I have a .sql file that updates my DB that I would like to have automatically kickoff daily.  I am not familiar with how to design this, whether it be through Integration Services or a batch file??  Any help would be greatly appreciated.  Thanks in advance. 

  • You can create SQL agent job to run sql file and schedule it to run daily.

    Thanks,

    SR

    Thanks,
    SR

  • integration services would be the best bet

    although in theory you could use windows scheduler and .sql script

     

  • Thanks for the help so far, does anyone have an example of any of the above posts?

  • In Management Stuido, Open SQL Server Agent, then Jobs, and click on jobs.

    Right click on the pane, and 'create new job'. Give it s good, descriptive name and preferably a description.

    Clicks on the 'steps' and use the 'new' button at the bottom of the pane to create a new step. this will be what runs your SQL.

    In the STEP pane, give the step a decent descriptive name, leave TYPE as transact-SQL, set run as to a reasonable user (don't use sa etc. UNLESS YOU NEED TO). Use least rights required principle.

    Copy and paste your SQL into the command pane. PARSE it to ensure it's all good.

    Set DB if necessary - I usually think it's good practice to set to required target database.

    You are done with the SQL (unless you need to add more steps, and start playing about with control logic).

    Click OK. Now go to the schedules page. Add a new schedule, and define it per your requirements.

    Consider setting up alerts and notifications, especially for failures!

     

    HTH

  • Great instructions, I'll give it a try.  Thanks!

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply