Link to home
Start Free TrialLog in
Avatar of oksum73
oksum73

asked on

Auto run Stored Procedures or Functions

I have mad a friendship site where i need to auto update recordsets each 1 min, 10 min, 1 hour and so.
Is it possible to create a Stored Procedure or Function that does this every now and then based on time?

If yes please tell me how with an example and if no, whatr shold I do then?
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

yes, just create sql server agent job(s) to schedule sql statements to be run regulary.
Avatar of oksum73
oksum73

ASKER

How do I do that ? I do not know how to do that, an explenation please?
The tutorials that I sent will walk you through how to set up a job using SQL Server management studio.
Avatar of oksum73

ASKER

I would need to know how to create an Stored Procedure or Function to update a table too
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of oksum73

ASKER

Ok i have created the stored procedure and it works,but how do i connect that to SQL Server agent job?
assuming that you found meanwhile how to create a sql server agent job (ie where they are located: management -> sql server agent -> jobs) , you simply put in a job step the sql command exec yourprocedurename
Avatar of oksum73

ASKER

ok what type shold i use T-SQL?
Yes, t-sql.
Avatar of oksum73

ASKER

in the command field:  "exec yourprocedurename"