Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 513205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:23:54+00:00 2026-05-13T07:23:54+00:00

I want to create a query to list of all user defined stored procedures,

  • 0

I want to create a query to list of all user defined stored procedures, excluding the ones that are system stored procedures, considering that:

  1. Checking the name like “sp_” doesn’t work because there are user stored procedures that start with “sp_”.
  2. Checking the property is_ms_shipped doesn’t work because there are system stored procedures that have that flag = 0, for example: sp_alterdiagram (it is not MSShipped but appears under System Stored Procedures in SQL Server Management Studio).

There must be a property, or a flag somewhere since you can see the “System Stored Procedures” in a separate folder in SQL 2005. Does anyone know?


Edit: A combination of the suggestions below worked for me:

select *
from 
    sys.objects             O LEFT OUTER JOIN
    sys.extended_properties E ON O.object_id = E.major_id
WHERE
    O.name IS NOT NULL
    AND ISNULL(O.is_ms_shipped, 0) = 0
    AND ISNULL(E.name, '') <> 'microsoft_database_tools_support'
    AND O.type_desc = 'SQL_STORED_PROCEDURE'
ORDER BY O.name
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:23:55+00:00Added an answer on May 13, 2026 at 7:23 am

    You should use something like this:

    select * from sys.procedures where is_ms_shipped = 0
    

    As you could guess, the key is in is_ms_shipped attribute (it exists in sys.objects view as well).

    UPDATED. Initially missed your point about is_ms_shipped.

    This is the code (condition) that Management Studio actually uses to retrieve a list of ‘system stored procedures’

     CAST(
     case 
     when sp.is_ms_shipped = 1 then 1
     when (
        select 
            major_id 
        from 
            sys.extended_properties 
        where 
            major_id = sp.object_id and 
            minor_id = 0 and 
            class = 1 and 
            name = N''microsoft_database_tools_support'') 
        is not null then 1
     else 0
     end AS BIT) = 1
    

    Here sp refers to sys.all_objects system view.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a query that selects the columns PlayerName , PlayerNumber, Location,
I want to create a query in TFS that allows me to view only
Can anyonen help with Teradata? I want to create a query that is a
I want to create an SQL query that selects the pictures of females in
I want create wordpress website into which I want create user management... That means
I want to create JSON object using tow query in PHP , Then retrieve
I want to make this kind of query: create procedure something @name varchar(13) as
I've a query that creates a SQL Statement as a field. I want to
I want DBSession.query(Article).group_by(Article.created.month).all() But this query can't using How do I do this using
I have created a list of contact's in user phone, now i want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.