Question

This is pretty weird.

I have my Profiler open and it obviously shows that a stored procedure is called. I open the database and the SP list, but the SP doesn't exist. However, there's another SP whose name is the same except it has a prefix 'x'

Is SQL Server 2005 mapping the SP name to a different one for security purposes?

EDIT: I found out it's a Synonym, whatever that is.

Was it helpful?

Solution

In general, when you know an object exists because it's been used in a query, and you can't find it in the object tree in Management Studio, you can do this to find it.

select *
from sys.objects
where name = 'THE_NAME_YOU_WANT'

I just checked, and it works with Synonyms.

OTHER TIPS

Possibly silly questions, but just in case... have you refreshed the SP list? Have you checked for a stored procedure of that name under a different owner? If you created the stored procedure without specifying the owner then it could be in the list under your ownership (or not at all if the list is filtered to only "dbo" for example).

You may not have permission to see all the objects in the database

Adding to the previous answers, it could also be under "System Stored Procedures", and if the name of the stored procedure begins with "sp_", it could also be in the master database.

The stored procedure will be inside the database you have selected at time of stored procedure creation. So search inside the database from which it is extracting data, otherwise it will be inside the master database. If still you are not able to find then first number solution is best one. i.e.

select * from sys.objects where name = 'name of stored procedure'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top