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

I have two Microsoft SQL Server 2000 databases, and a stored procedure on one
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
I'm about to have to rewrite some rather old code using SQL Server's BULK
This question is about Why does autoboxing make some calls ambiguous in Java? But
So this morning I posted a confused question about assembly and I received some
I have some questions about the performance of this simple python script: import sys,
This question about Timers for windows services got me thinking: Say I have (and
I've done some searching around but I have a specific question on SQL Injection
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.