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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:11:38+00:00 2026-05-21T09:11:38+00:00

This is a question about some stored procedures running on MSSQL 8 (I think

  • 0

This is a question about some stored procedures running on MSSQL 8 (I think that’s SQL Server 2000).

I have two stored procedures left by my predecessor at the company.

The “Modify” window for the first procedure looks something like this:

ALTER PROCEDURE [dbo].[Proc1]
    @ID,
    @someBool

AS
BEGIN

SELECT colA, colB, colC
FROM   myTable
WHERE  colA = @ID AND colB = @someBool

END

The second procedure is very similar, being something along the lines of:

ALTER PROCEDURE [dbo].[Proc2]
    @ID

AS
BEGIN

SELECT colA, colB
FROM   myTable
WHERE  colA = @ID AND colB = FALSE

END

Obviously, the real procedures are more complicated than this and require a lot more maintenance when changes are made.

Rather than maintaining these two queries separately, which pretty much sucks, I was wondering if there was any way to simply have Proc2 do something along the lines of:

ALTER PROCEDURE [dbo].[Proc2]
    @ID

AS
BEGIN

EXEC Proc1(@ID, FALSE)
"drop colC"
"return modified result"

END

Any ideas on the best way to go about this?

  • 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-21T09:11:39+00:00Added an answer on May 21, 2026 at 9:11 am

    Maybe something like this?

    CREATE TABLE #Proc1TempResults
    (
        ColA INT, --OR WHATEVER DATA TYPE
        ColB INT,
        ColC INT
    )
    
    INSERT INTO #Proc1TempResults (ColA, ColB, ColC)
    EXEC Proc1 @ID, 0
    
    SELECT ColA, ColB
    FROM #Proc1TempResults
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a question I have wondered about for quite some time, yet I
I have read these very good questions on SO about SQL stored procedures: When
What are your thoughts about SQL Server's symmetric key functions? Specifically, I have two
This question is about Why does autoboxing make some calls ambiguous in Java? But
I have a question about this question . I posted a reply there but
This question is about App domains and Sessions. Is it possible to have IIS
I have a stored procedure that does, among other stuff, some inserts in different
I have 3 home PCs that have 2008 SQL Server Express instances installed on
This is a high-level question about web frameworks, that as a desktop app developer,
I have an ASP.NET MVC Web Application that interacts with a SQL Server 2008

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.