SQL Server Performance

Timed execution in SQL

Discussion in 'SQL Server 2005 General Developer Questions' started by Garush666, Dec 10, 2006.

  1. Garush666 New Member

    Hi all,
    I have question on Trigger execution.
    Literally, it may not be a trigger execution. But may be any thing in SQL Server.

    I want to execute a query at 12.00 night. How acan i do this?

    Am using SQL Server 8.0

    Any one out there to help me?

    Regards
    Garush
  2. madhuottapalam New Member

    Hi,

    I not quite sure what u mean by SQL Server 8.0. Since u have posted it in the SQL Svr 2005 section i assume that it Compaitibility 80.

    coming to your question, You can create Jobs to run scripts on a scheduled intervel. Job itself can have SQL Script or you can create a storedprocedure and create a job to run that SP.

    It can not be Trigger. Trigger run only when an action (insert/update/delete/create/drop etc) occurs in Table/View/Database/Server depend upon where you have created.

    Madhu
  3. Garush666 New Member

    Thanks Madhu.

    Can u help on creating Jobs and the SQL Script to do that work for me?
  4. madhuottapalam New Member

    Hi ,

    It is not clear what u want to do. Creating Job you can try yourself. Refer Book On Line (BOL).

    follow this path
    SQL Managemet Studio -->SQL Server Agent --> Jobs .

    Makesure that SQLServerAgent Service is running

    also refer this link :

    http://msdn2.microsoft.com/en-us/library/ms190268.aspx

    Madhu
  5. DilliGrg Member

    quote:Originally posted by Garush666

    Hi all,
    I have question on Trigger execution.
    Literally, it may not be a trigger execution. But may be any thing in SQL Server.

    I want to execute a query at 12.00 night. How acan i do this?

    Am using SQL Server 8.0

    Any one out there to help me?

    Regards
    Garush


    I was not aware of that the SQL Server 8.0 exist. [?] Are you sure you are not talking about Oracle?

    Thanks,
    DilliGrg
  6. Adriaan New Member

    SQL Server 8.0 is perhaps better known as SQL Server 2000.
  7. MohammedU New Member

    SQL 2000 - 8.0
    SQL 2005 - 9.0



    Mohammed U.
  8. satya Moderator

    Can you explain a bit by stating why you want to execute this trigger atthat point of time?

    Satya SKJ
    Microsoft SQL Server MVP
    Contributing Editor & Forums Moderator
    http://www.SQL-Server-Performance.Com
    This posting is provided AS IS with no rights for the sake of knowledge sharing.
  9. Garush666 New Member

    Thanks all friends,

    In my application i would like to insert a record in to a table in my Database by 12.00AM every day. How can i do this.

    [Actually i thought Trigger can do this. But from above replys i came to a conclusion that it cannot be solved by using the Triggers]
  10. Adriaan New Member

    A trigger only responds to an insert/update/delete action on a table.

    The best way is to schedule a job.
  11. Garush666 New Member

    Thakns for showing intrests friends.
    Am working on it. Let me come when i get problem again.

    Garush
  12. madhuottapalam New Member

    Create a SP with the same logic, which you thought for the Trigger and create a job to run that SP and schedule the JOB at 1200 AM.


    Madhu

Share This Page