Auto Running (Scheduling) CLR Procedures

  • Is there any way to schedule the CLR Procedures in SQL Server 2005,

    OR to schedule Normal DB Procedures in SQL Server 2000 ?

  • Sure, use the service broker - whats the procedure, what parameters does it need and when do you want it to fire?

  • Sorry, I havent use Service Broker before....can u plz explain abt the process

  • whats the procedure, what parameters does it need and when do you want it to fire?

    If you provide this information I can provide a more comprehensive answer.

  • Actually there are different Procedures with different number and type of parameters with different execution intervals.

    For example consider following procedure.......I want to execute this procedure after every hour.

    CREATE

    PROCEDURE IPM_IBoiler_CLR_BM_FuelCost

    @ServerID VARCHAR(50),

    @ServerName VARCHAR(200),

    @IBoilerSystemId VARCHAR(50)

    AS

    EXTERNAL NAME

    [IB_BM_ClrStoredProcs].[iBoiler.BM.ServerCalculators.EventsCalculator].[FuelCostEvents];

    go

  • Some one can please help me, its very urgent.

  • Hi,

    The point is that if you schedule this stored procedure to run every hour what will happen? Nothing. It's got no input for the paramters.

    J

  • But in any case;

    First you need to create a job (sp_add_job), create a step in the job that executes your procedure (sp_app_job_schedule) - you'll need to put input parameters in here, then create the schedule (sp_add_schedule) and tie the two together (sp_attach_schedule).

    You can also do this through SSMS:

    Object Explorer > SQL Server Agent >Right-click Jobs > New Job and play with the steps and schedule there.

  • does it mean that we can not schedule a stored procedure that needs parameters ?

    If the answer is yes, then i think we can use a temp table with columns equal to the parameters of Stored procedure, and assume that before the scheduled execution time of the stored procedure values will be available in the temp table, and in the procedure we can access the values from that table (in this  case we will modify the procedure so that it dont have any parameters),

    wat do u think will it work...?

Viewing 9 posts - 1 through 8 (of 8 total)

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