SQL Agent questions

Results 1 to 2 of 2

Thread: SQL Agent questions

  1. #1
    Join Date
    Dec 1969

    Default SQL Agent questions

    Hi, <BR><BR>I am trying to set a job in SQL agent. (I am new to SQL agent), just a few questions hoping someone can help me onto the right track. (I am using SQL 7)<BR><BR>Basically I want to set up a schedule task to perform some update on two different tables in the database. When I connect to the SQL server I select &#039;Management&#039; followed by Job and then create a new job, my questions are : <BR><BR>1.check timestamp against current time on table A, if &#039;diff&#039; more than 20 minutes I need to perform 2 different actions. <BR>a. delete this particular entry on table A<BR>b. update one field in another table<BR><BR>can it all be done in one step or do I have to create 2 steps?<BR><BR>2. Is it better to use Transact -SQL Script? I am familiar with ASP, can I select ACTIVE script then in the &#039;other&#039; field type in ASP? If so can I use ASP just the way like I normally code in ASP page?<BR><BR>If I have to use Transact-SQL script where can I find good resource to learn?<BR><BR>Many thanks<BR><BR>James<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL Agent questions

    You can create a DTS package and schedule that. In the package add a SQL task and put the code in that task.<BR><BR>For the checkpart you need the datediff function. If you need more detailed help, post details about your tables.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts