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 7005751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:23:26+00:00 2026-05-27T21:23:26+00:00

I have an application that queries and updates two databases at the same time

  • 0

I have an application that queries and updates two databases at the same time (different from each other) and it has already around 10 to 15 years of usage. So I would like to start clearing up the garbage from them.

One of the things that I want to do is to remove all the stored procedures that are in database B that by mistake were created there (because they had to go in database A).

If I do one by one, is easy because I can tell if the sp uses a table that is not in that database. But I bet there are many of them, so I want to get a query that validates this.

This is the link from microsoft that explains this: http://msdn.microsoft.com/en-us/library/ms190686.aspx. But it doesn’t give me any solution! :S

I tried the below method:
http://beyondrelational.com/blogs/jacob/archive/2009/01/28/tsql-how-to-revalidate-refresh-recompile-all-stored-procedures-in-a-database.aspx

But it worked for some, but not for all.

So do you guys know any effective method that will work 100% of the time?
Tryouts:

  • Recompilation > NOT
  • sp_refreshsqlmodule > works for most, but not all
  • sp_depends > it may work since all the SPs need to have a dependency on a table (at least most of them). UPDATE: This doesn’t work either. If I have a sp that looks for tables in both databases, it will resolve those that can, but not all. So I can’t rely on “if no dependencies, candidate to delete”.

Thanks in advance

  • 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-27T21:23:27+00:00Added an answer on May 27, 2026 at 9:23 pm

    There is no guaranteed way.

    Deferred name resolution (as in if a table isn’t there, give an error) applies at compile time, not create time. Although there is some evidence to show that code may run with missing tables

    It has been requested though: see the proposed SET OPTION STRICT ON MS Connect request which comes from Erland Sommarskog

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

Sidebar

Related Questions

In my application, I have two queries that occur from time to time (from
I have application that makes different queries with different results so the caching in
I have written a console application in Delphi that queries information from several locations.
I have a MySQL table from a third-party application that has millions of rows
In my web application there is a process that queries data from all over
I have written an application that queries a web service I wrote (which returns
In my Web Application, i have a data table(Displayed from DB using PreparedStatement). Each
I have application that is connecting to the DB and if I enter incorrect
I have application that is up more than 3 days. I can see in
I have application that brings response via Ajax and creates 5-20 new jQuery click

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.