Now that you have a batch file that calls the regular_dw.sql script, you can proceed with scheduling it with Windows Scheduled Task. The following provides step-by-step instructions on how to do it.
Open your Control Panel and select Scheduled Tasks.
Click Select Add Scheduled Task. The first screen of the Scheduled Task Wizard will appear, as shown in Figure 9.1.
Figure 9.1: The first window of the Scheduled Task Wizard
Click Next. You will see the second window of the Scheduled Task Wizard. Locate Command Prompt from the Application list. Figure 9.2 shows the window after you select the application to be scheduled.
Figure 9.2: Selecting an application to schedule
Click Next again, you will see the third window of the Scheduled Task Wizard, as shown in Figure 9.3. Type in “DW Regular Load” as the name of the scheduled task and select Daily from the “Perform this task:” option list.
Figure 9.3: Entering a name and select a schedule
Click Next again and you will see the next screen that prompts you to select a time for invoking the scheduled task, as shown in Figure 9.4.
Figure 9.4: Setting the time
Click Next again. The next window appears, as shown in Figure 9.5. You will be asked to enter the name and password of the user whose credentials will be used to run the task.
Figure 9.5: Entering Windows user name and password to run the task
Click Next. The next window in the Scheduled Task Wizard appears, as shown in Figure 9.6.
Figure 9.6: The next window
Enable the Open advanced properties for this task when I click Finish check box and click Finish.
The Advanced Properties window will appear, as shown in Figure 9.7.
Figure 9.7: The Advanced Properties window
. Click the Browse button and browse the file system and select the dw_regular_load.bat file.
. Click the Set password button and you will see the Set Account Information box similar to Figure 9.8. Type in your user name and password and click OK.
Figure 9.8: Setting account information
The daily scheduled task of your data warehouse regular load is now set up. It will start to run at the date and time you specified. You can see a new icon in the Scheduled Tasks window, as shown in Figure 9.9.
Figure 9.9: Your DW Regular Load task