5

Can you please help me how to execute a stored procedure automatically in SQL database without any transaction in SQL? I want to execute on particular fix time.

5
  • 1
    What database system are you using? SQL Server (Microsoft), MySQL, other? Please edit your question to add a tag for that. Also, what have you tried so far, what did you find in your research and why didn't that work?
    – Mat
    Commented Sep 20, 2013 at 5:52
  • It's a stored procedure - a procedure stored inside your database system. It has nothing to do with a "store" per se ...
    – marc_s
    Commented Sep 20, 2013 at 8:31
  • how about this? stackoverflow.com/a/8688446/2186023 and then just let task scheduler take control of that... Commented Sep 20, 2013 at 8:45
  • 2
    And you can not execute anything in SQL without a transaction. ANYTHING is in a transaction - explicit or implicit.
    – TomTom
    Commented Sep 20, 2013 at 9:13
  • Cross-site duplicate of stackoverflow.com/q/4079363/164901 -- I recently implemented the Service Broker solution for one of our projects here, and I can tell you that it's not exactly newbie-friendly. It is a great solution, though.
    – Jon Seigel
    Commented Sep 20, 2013 at 13:31

4 Answers 4

8

If you are not comfortable using Powershell, then you can go for native service broker functionality.

0
6

With SQL Server Express, you could use powershell to execute a stored procedure automatically through Windows scheduler service.

There is a great article that shows how to use Powershell to EXEC stored procedures here:

http://www.maxtblog.com/2010/10/basic-sql-server-stored-procedure-scripting-with-powershell/

You can also look at this question that deals with using Powershell:

Is there any collection of PowerShell scripts that help the task of SQL Server maintenance?

0
2

Not sure what you mean by "without any transaction". But normally timed scripts / tasks are executed as jobs, through the SQL Server Agent. See here for an example and explanation.

https://stackoverflow.com/questions/1216272/how-to-execute-a-stored-procedure-in-a-sql-agent-job

2
  • @Khan SQL Agent is not available in Express edition.
    – Kin Shah
    Commented Sep 20, 2013 at 13:03
  • Ah, tags. Good point. :)
    – Kahn
    Commented Sep 23, 2013 at 4:40
-1

The answer to the question "How to make a stored procedure automatic with execution parameters" in Sql server is simple, we will only have to go to the SQL server Agent, "New" -> "Job" -> we will use three tabs "General"," Steps","Schedules" in "General" we will only give it a name, "Steps" ->"New" and here we will have to add the execute of the stored procedure, "Schedules" we make the execution time parameters and save, I hope this is of help to someone, greetings

3
  • 1
    The question is tagged "SQL Express" which does not have SQL Agent as an option. Commented Jun 28, 2023 at 15:30
  • 1
    It also sounds like its from chatgpt. Commented Jun 28, 2023 at 20:32
  • La pregunta esta etiquetada como "Como ejecutar automáticamente un procedimiento almacenado" por eso específico para aquellos que buscan una solución en SQL server --Saludos Commented Jun 28, 2023 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.