How to execute Stored Procedure at specific time

  • Hi every body,

    I want to execute Stored Procedure at specific time,

    Example:

    Suppose in my website i have Users, and i want to block one User to prevent him from add topics,

    i will block him and store in database datetime 08/12/2011 06:59:13 am to remove the block.

    i want when the datetime 08/12/2011 06:59:13 am in database is come an stored procedure is execute and remove the block for specific user

    How to do that please

    Thanks.

  • Hello,

    the way to do it is using SQL Server Agent, it allows you to program specific tasks to be executed at specific time.

    You should start SQL Server Agent and ideally you should configure it to start when SQL Server starts.

    Regards,

    Francesc

  • Put code simlar to the followind in a SQL agent job and set the job schedule to the required time. The user running the SQL agent must have the correct permissions on the database.

    DECLARE @rc int

    EXECUTE @rc = [databasename].[schema].[stored Proc name]

    GO

  • just use sql server agent job to do it

    very simple

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply