Timed execution in SQL | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Timed execution in SQL

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
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

Thanks Madhu. Can u help on creating Jobs and the SQL Script to do that work for me?
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
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
SQL Server 8.0 is perhaps better known as SQL Server 2000.
SQL 2000 – 8.0
SQL 2005 – 9.0 Mohammed U.
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.
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]

A trigger only responds to an insert/update/delete action on a table. The best way is to schedule a job.
Thakns for showing intrests friends.
Am working on it. Let me come when i get problem again. Garush
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

]]>