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

  • SEARCH
  • Home
  • 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 9156579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:48:27+00:00 2026-06-17T12:48:27+00:00

I have 200 Stored Procedures in my Sql server 2008 R2 database that are

  • 0

I have 200 Stored Procedures in my Sql server 2008 R2 database that are automatically generated by an application. Now I want to delete them all and regenerate them because the tables have changed a lot.

This question is very similar to my case but in my case all the SP’s start with sp_ and I thinks it’s dangerous to use the same code since system SP’s also start with sp_ and I may kill them all.

Should I trust the solution in the link above? If not is there any safer solution?

  • 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-06-17T12:48:28+00:00Added an answer on June 17, 2026 at 12:48 pm

    If this is a one- time task, just open Object Explorer, expand your database > programmability and highlight the Stored Procedures node. Then turn on Object Explorer Details (F7 I think). On the right you should see your list, and here you can multi-select – so you can sort by name, choose all procedures that start with sp_, and delete them all with one keystroke.

    If you are doing this repeatedly, then (assuming your procedures are all in the dbo schema):

    DECLARE @sql NVARCHAR(MAX) = N'';
    
    SELECT @sql += N'DROP PROCEDURE dbo.'
      + QUOTENAME(name) + ';
    ' FROM sys.procedures
    WHERE name LIKE N'sp[_]%'
    AND SCHEMA_NAME(schema_id) = N'dbo';
    
    EXEC sp_executesql @sql;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

we have a portal that have SQL server 2005 database that contain about 1750
I have a database which consists of almost 200 tables and 3000 stored procedures.
We have a SQL Server DB with 150-200 stored procs, all of which produce
I have a large SSRS 2008 Server Report Project (more than 200 reports). Currently
I'm noob at stored procedures, I have created a stored procedure that take some
I have a small issue with a stored procedure in SQL Server 2005. RepInfoID(primary),
Me and my colleagues have a question regarding SQL Server 2008 query length and
During developing an application with LINQ to SQL, I found that when a stored
I have a stored procedure that adds an object to the database and returns
I have an SQL query that takes these parameters: @SearchFor nvarchar(200) = null ,@SearchInLat

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.