Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2015
    Posts
    3

    Exclamation Unanswered: How to execute some store procedure periodically

    Good day Sir, friednds,
    I have a task that must be done every spesific day.
    I want some procedure to be execute every spesific day. How could I do it?
    Thank you..

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    You can schedule a job in SQL Agent.

    https://msdn.microsoft.com/en-us/library/ms191439.aspx

  3. #3
    Join Date
    Dec 2015
    Posts
    3
    Thank you Sir for the suggestion for the solution..

  4. #4
    Join Date
    Dec 2015
    Posts
    3
    Quote Originally Posted by MCrowley View Post
    You can schedule a job in SQL Agent.

    https://msdn.microsoft.com/en-us/library/ms191439.aspx
    I think I have successed for creating the schedule.
    The thing that I do not know is how to add my store procedure to the schedule so that my store can be executed belong to the schedule.
    Click image for larger version. 

Name:	schedule.png 
Views:	1 
Size:	3.5 KB 
ID:	16666

    This is my store procedure that I want to be executed.

    Code:
    CREATE PROCEDURE sp_insert_country
    AS
    	insert into country values('6', 'Miyanmar')
    RETURN 0
    One that I confused is how can my store procedure can be executed because my store procedure is on the other database.

  5. #5
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Perhaps I should have started you here:

    https://msdn.microsoft.com/en-us/library/ms190268.aspx

Tags for this Thread

Posting Permissions

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