Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How to create a batch file to schedule a job by using Windows Task Scheduler when you use Microsoft Dynamics GP on a computer that is running SQL Server Express Edition


INTRODUCTION

This article describes how to create a batch file to schedule a job by using Windows Task Scheduler when you use Microsoft Dynamics GP on a computer that is running Microsoft SQL Server 2005 Express Edition or Microsoft SQL Server 2008 Express Edition.

↑ Back to the top


More Information

If you are running SQL Server 2005 Express Edition or SQL Server 2008 Express Edition on the computer, the SQL Server Agent service is unavailable.


When you use Microsoft Dynamics GP together with Microsoft SQL Server Express Edition, Microsoft Dynamics GP creates a default job to truncate the PJOURNAL table for each company database. The PJOURNAL table stores temporary records that are related to posting. Because the SQL Server Agent service is not available, you must use Windows Task Scheduler to schedule these jobs when you use SQL Server Express Edition.

To create a batch file to schedule a default job by using Windows Task Scheduler, follow these steps:
  1. In Notepate, paste the following code:
    OSQL -S <SERVERNAME> -E -q "exit(DELETE <DBNAME>..PJOURNAL)"
    Note The SERVERNAME placeholder represents the name of your instance of SQL Server. The DBNAME placeholder represents your company database name.
  2. If you have multiple company databases, you must create a delete statement for each company. Then, you must add this delete statement to the Notepad file that you created in step 1. Or, you can create a separate batch file for each company.
  3. Click File, click Save, and then save the file as "PJOURNAL.bat".
  4. On the computer that is running Microsoft SQL Server Express, click
    Start, point to All Programs, point to
    Accessories, point to System Tools, and then click Scheduled Tasks.
  5. Double-click Add Scheduled Task.
  6. In the Scheduled Task Wizard, click
    Next.
  7. Click Browse, click the PJOURNAL.bat file that you created in step 4, and then click
    Open.
  8. Type PJOURNAL for the name of the task, and then click Daily. Then, click
    Next.
  9. Specify information for a schedule to run the Task. We recommend that you run this at least one time every day. Then, click Next.
  10. In the Enter the user name field and in the Enter the password field, type a username and a password. Then, click Next.
  11. Click Finish.
Note Microsoft Dynamics GP 9.0 is not supported on SQL Server 2008. However, Microsoft Dynamics GP 9.0 is supported on SQL Server 2005.

↑ Back to the top


Keywords: kbexpertiseadvanced, kbmbspartner, kbexpertiseinter, kbhowto, kbinfo, kbmbsmigrate, kbexpertisebeginner, kb

↑ Back to the top

Article Info
Article ID : 958368
Revision : 1
Created on : 1/7/2017
Published on : 7/14/2012
Exists online : False
Views : 97