question

Bhupendra99 avatar image
Bhupendra99 asked

Check for Sp existence without using sys.

I want to check whether a particular sp is there or not in db is there any way apart from using sys.objects,sys.procedures,sys.comments that is apart from anaything that start with Sys. We are not given right to use any Sys. so I am asking for others ways to check for sp without using Sys.
search
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

This web site runs based on your votes. Please indicate all the helpful answers below by clicking on the thumbs up next to them. If any one answer lead to a solution, please indicate this by clicking on the check mark next to that answer.
0 Likes 0 ·
Kev Riley avatar image
Kev Riley answered
Can you use information Schema views? e.g. select * from INFORMATION_SCHEMA.ROUTINES
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

KenJ avatar image
KenJ answered
I like lists. Here's another: if (select object_id('particular sp')) is null -- do something... One thing on MSDN worth noting is that > The visibility of the metadata in catalog views is limited to securables that a user either owns or on which the user has been granted some permission This applies to the catalog views and the information schema views so, depending on your permissions, you still may not be able to check for existence - [ https://technet.microsoft.com/en-us/library/ms187113%28v=sql.110%29.aspx][1] [1]: https://technet.microsoft.com/en-us/library/ms187113%28v=sql.110%29.aspx
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.