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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:30:30+00:00 2026-05-17T02:30:30+00:00

I worked on a project that had the following requirement: TableA is the parent

  • 0

I worked on a project that had the following requirement:

TableA is the parent table. Whenever any children records of TableA are updated the ‘LastActivityDate’ field in TableA should be updated with the current UTC date.

Now, I know there are many ways of doing this. My post is NOT about the many different ways this could be accomplished.

I originally suggested using triggers for this requirement and our DBAs shot me down because they don’t want triggers in this DB (I don’t know why, and it isn’t important to my question). I ended up creating a stored proc that’s only purpose was to update TableA.LastActivityDate. I then coded the update/insert stored procedures of TableA’s children to call this stored proc. So, for example, a child’s update stored proc would look like this:

Create Procedure TableB_UPD
(
 @TableBId INT
 @TableBName VARCHAR(30)
)
AS
BEGIN
 UPDATE dbo.TableB
 SET TableBName = @TableBName
 WHERE
  (TableBId = @TableBId)

 DECLARE @TableAId INT
 SELECT
  @TableAId = TableAId
 FROM
  dbo.TableB
 WHERE
  (TableBId = @TableBId)

 EXEC dbo.TableA_LastActivityDate_UPD @TableAId
END

It’s pretty straight forward code, I call the dbo.TableA_LastActivityDate_UPD stored proc from within the TableB_UPD stored proc. When our DBAs saw this they refused to allow it in their DB. They told me that there is a huge performance hit from calling a stored procedure within a stored procedure. I have been unable to find any good online articles to support this statement (and the DBAs haven’t been able to give me any either).

I’ve seen this kind of code in lots of databases and never heard of any performance issues until now. My question is this: Can someone explain the performance issues around this type of code? I would greatly appreciate references to articles as well.

This is in SQL Server 2005.

  • 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-17T02:30:31+00:00Added an answer on May 17, 2026 at 2:30 am

    When in doubt, look at execution plans and SQL Profiler to make sure your procedures perform optimally. They can tell you more about the situation than we ever could.

    The only issue I can think involving nested stored procedures that could even remotely be considered a problem would be error handling in nested stored procedures with transactions, but you don’t seem to have that going on here. And really, my example is more of a case of “Write your stored procedure properly.”

    As it stands though, nested stored procedures being a “huge performance hit” is news to me, and I sure can’t find anything supporting that statement either.

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

Sidebar

Related Questions

If you've worked on a project that stores data for use with the semantic
I once worked on a C++ project that took about an hour and a
I am starting a new Java web project that will be worked on by
I've worked with ASP.NET once before and had a project where it was potentially
I was following a tutorial today that had me scratching my head for an
I've worked on Death March projects in the Java world - projects that are
I have a few Visual Studio Solutions/Projects that are being worked on in my
How have you used the Exception.Data property in C# projects that you've worked on?
I believe several of us have already worked on a project where not only
Recently, I have worked in a project were TDD (Test Driven Development) was used.

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.