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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:41:09+00:00 2026-05-19T11:41:09+00:00

Hi This statements are executed in Stored Procedure. I am passing parameters and It

  • 0

Hi
This statements are executed in Stored Procedure. I am passing parameters and It is doing multiple updates and inserts.
I will appreciate some suggestions to
-improve the performance,
-reduce the execution time
-and improvements in code structure.
There are three different tables: Table_01, Table_02, Table_03.

INSERT INTO Table_01(
    TestID,     
    TestData,
    CurrentDate,
    UserID,
    Status
) VALUES (
    @testID,        
    @testData,
    @iDateTime,
    @userID,
    @Status
)

IF (@Status = 1) 
BEGIN 

    DELETE FROM
        Table_02
    WHERE 
        TestID = @testID

    UPDATE Table_03
    SET
        Status = 1,
        Date = @iDateTime,
        Work = 0
    WHERE
        TestID = @testID
END
  • 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-19T11:41:10+00:00Added an answer on May 19, 2026 at 11:41 am

    Not really much to tweak to be honest: it’s straightforward code, nothing fancy

    You can add a transaction so it all writes succeed or all writes fail.

    If you find the code slow then I’d look at indexes on TestID and do you have triggers

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

Sidebar

Related Questions

I have multiple SQL stored procedures (e.g. UPDATE, SELECT INTO statements) executed in VBA
Are statements after END in stored procedure executed? I found that a stored procedure
I have created a stored procedure shown below ,how will i call this from
I have some third-party Javascript that has statements like this: FOO = function() {
I have stored-procedure in Oracle database like this: create or replace PROCEDURE EDYTUJ_PRACOWNIKA (PR_IMIE
The stored procedure builds without any problem. The purpose of this is to take
I have this code which calls a stored procedure within ZEND. Is there a
I am passing a comma-delimited list of values into a stored procedure. I need
I want to create SQL statement (probably a stored procedure) to insert multiple rows
I'm analyzing some old SQL code in a stored procedure. Declare @Var1 money, @Var2

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.