I am studying the SQL procedure.
I created a procedure and I execute. I was fine... and. it displayedCould not find stored procedure wh开发者_开发技巧en executed "exec my_procedure"
I am not really sure the reasons I am getting this error. Did I choose the wrong directory to store the procedure?
You are probably not in the right database within the query window. There should be a dropdown that shows the current database (possibly master). Choose the database you created the stored procedure in and then try again.
Try this:
USE my_database;
EXEC my_procedure;
It tough to tell this could happen for several reasons.
you didn't actually execute the
create proc
when you thought you wereyou accidentally executed
drop proc
You're not connected to the right DB when you called
exec my_procedure
You're using a different log on and it doesn't have access to the procedure
Its in a different schema than your default schema
You could run this to see if you proc is there at all in a given DB (or drop the where to see them all)
select *
from INFORMATION_SCHEMA.ROUTINES
where ROUTINE_NAME = 'my_procedure'
That said saving the Procedure Creation Script has no impact on your ability to execute it
You can find all stored procedures by using the following command
exec my_database.my_schema.my_procedure
if still fail, can you provide us sp create a script?
精彩评论