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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 problem in execute the stored procedure
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

13 Posts

Posted - 03/16/2013 :  13:08:22  Show Profile  Reply with Quote
i craete a SP in my database . by this command :
USE [MyDatabase];
    SELECT id, feed1, feed2
    FROM NFFeeds

i can see this sp under StoredProcedure in my database .
so...i write this command in Query :
use [MyDatabase]
exec dbo.test

at this time a red underline appear under 'test' . if i set mouse cursor on it this error shows as a tag :
"Could not find stored procedure 'test' "
but if i execute the sp , it's execue normal and i can show the result . what this mean?


5072 Posts

Posted - 03/16/2013 :  14:20:35  Show Profile  Visit russell's Homepage  Reply with Quote
your default schema is not dbo.

whatever it is should replace dbo in your query. OR when creating it, explicitly create in under dbo schema.

CREATE PROC dbo.Test...

If you aren't sure what schema you created it under, this will show you

select schema_name(schema_id) from sys.procedures where name = 'test'
Go to Top of Page

Starting Member

13 Posts

Posted - 03/16/2013 :  16:43:56  Show Profile  Reply with Quote
i checked it.the default schema was dbo.
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 03/16/2013 :  21:30:22  Show Profile  Reply with Quote
Run the first line by itself and see if you still get the error squiggly. What I am suspecting is that the current database is something else and it does not see a stored procedure by that name in that database. However, that is only a guess - I am not seeing that behavior in my SSMS (SQL 2008 R2). What version of SSMS and database are you using?
Go to Top of Page

Starting Member

13 Posts

Posted - 03/17/2013 :  05:06:05  Show Profile  Reply with Quote
thanks... but with the help of frinds i find the solution :
Edit Menu/Intellisense/Refresh Local Cache ....... it's done
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000