Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Automattically excute a procedure

Author  Topic 

Ernie57
Starting Member

27 Posts

Posted - 2006-06-03 : 08:35:45
I am using MS sql 2000. I think I need to use SQL agent to run a job, but not sure how to call up the procedure! The procedure runs collectly when run from SQL query.

Thank You,

Ernie

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-03 : 09:13:01
use Enterprise Manager, Management - SQL Server Agent - Jobs
Create a job and specify Steps Type as TSQL.
exec your_stored_procedure



KH

Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2006-06-03 : 11:28:51
Dont forget

exec your_stored_procedure @With_parameter1,@With_parameter2 ...etc
Go to Top of Page

Ernie57
Starting Member

27 Posts

Posted - 2006-06-04 : 07:52:58
quote:
Originally posted by afrika

Dont forget

exec your_stored_procedure @With_parameter1,@With_parameter2 ...etc




What type of parameters would be needed, and without them what type of problems would this cause?

Thank You,

Ernie
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-04 : 08:47:40
"What type of parameters would be needed, and without them what type of problems would this cause?"
Depends on your stored procedure. What afrika posted is an example of calling a stored procedure with parameter pass in.

If your stored procedure does not required any input parameter, just
exec your_stored_procedure



KH

Go to Top of Page

Ernie57
Starting Member

27 Posts

Posted - 2006-06-05 : 07:38:23
I have the procedure executing by a schedule!

Thanks everyone for your help!

Ernie
Go to Top of Page
   

- Advertisement -