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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:38:42+00:00 2026-05-30T19:38:42+00:00

I have two tables in my database Requests and Balance tracker which has no

  • 0

I have two tables in my database Requests and Balance tracker which has no relation…. but I want to select data from two tables and bind it two grid…

Requests

EmpID | EmpRqsts | EmpDescription | ApproverID | ApprovedAmount | RequestPriority
   1  | asdfsb   | sadbfsbdf      |     1      |
   2  | asbfd    | sjkfbsd        |     1      |

Balance Tracker

EmpId | BalanceAmnt | LastUpdated | lastApprovedAmount
  1   |    5000     | sdfbk       |
  2   |    3000     | sjbfsh      |

Now I want to update both tables at a time, based on the EmpID. Whenever amount is approved, it should be updated in request table column [ApprovedAmount] and with priority…

When [ApprovedAmount] is updated [BalanceAmnt] Balance Tracker of also should be Updated by adding the amount approved,[LastUpdated],[lastApprovedAmount] should be updated with date and time

Can anyone help me with the query please….

  • 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-30T19:38:43+00:00Added an answer on May 30, 2026 at 7:38 pm

    First create a stored procedure to update your [ApprovedAmount] column

    create procedure SP_UpdateRequestedAmount
        (@EmpID int,
         @AmountApproved varchar (50),
         @RequestPriority varchar (50))
    as
    begin
        Update Requests   
        set ApprovedAmount = @AmountApproved,
            Request_Priority = @RequestPriority 
        where
            Emp_ID = @EmpID
    end
    

    Then use a triger to update the other table when ever [AmountApproved] column is updated

    CREATE TRIGGER tr_ApprovedAmount_UPDATE 
    ON Requests   
    AFTER UPDATE 
    AS 
        --Make sure Priority was changed 
        IF NOT UPDATE(ApprovedAmount) 
            RETURN 
    
        --Determine if Priority was changed to high 
    
        -- PUT your queries for Updatating other table 
         declare @Balance_LastUpdated date
         declare @ApprovedDate date
    
         UPDATE Balance Tracker
         SET Balance Tracker.Balance_BalanceAmount =  Balance Tracker.Balance_BalanceAmount +   PTS_Requests.Request_IsApproved,
             Balance_LastUpdated = @Balance_LastUpdated,
             Balance_LastApproval = @ApprovedDate
         FROM
             Balance Tracker 
         INNER JOIN
             Requests ON Balance Tracker.Emp_ID = Requests.Emp_ID
    

    Hope this helps………

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

Sidebar

Related Questions

I have two tables in my database named...Requests and Balance tracker which has no
I have two tables in my database named...Requests and Balance tracker which has no
I have two database tables. One table stores data for a commitment that a
I want to have the equivalent of two completely unrelated tables in my database,
I have a database model with two tables: Session and ScriptExecution which are associated
I have two database tables with the following structure: actions: action_id int(11) primary key
I have two tables in my database, called ratings and movies . Ratings: |
I have two tables in my database: NEWS table with columns: id - the
I have two tables in my database schema that represent an entity having a
I have two tables in my database. Comments CommentsID MembersID CommentsBy CommentsDesc CommentsActive CommentsDateEntered

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.