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?
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?
yes, just create sql server agent job(s) to schedule sql statements to be run regulary.
This will walk you through how to create a job.
http://technet.microsoft.com/en-us/library/ms186273.aspx
http://technet.microsoft.com/en-us/library/ms190268.aspx
http://technet.microsoft.com/en-us/library/ms186273.aspx
http://technet.microsoft.com/en-us/library/ms190268.aspx
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.
ASKER
I would need to know how to create an Stored Procedure or Function to update a table too
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
ASKER
ok what type shold i use T-SQL?
Yes, t-sql.
ASKER
in the command field: "exec yourprocedurename"