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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:16:40+00:00 2026-05-18T11:16:40+00:00

High level I have two tables that need to have some of the data

  • 0

High level I have two tables that need to have some of the data mirrored. I can’t go through and change all of the code to write to both so I thought I’d use a SQL trigger to insert data into the 2nd table anytime data is inserted into the 1st. Here is where I am stuck:

CREATE TRIGGER new_trigger_INSERT
ON old_table
FOR INSERT
INSERT INTO new_table (id, first_name, last_name)
VALUES () --This is where I'm lost, I need to insert some of the data from the insert that executed this trigger

Any help is appreciated, also if there is a better way to accomplish this let me know.

  • 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-18T11:16:40+00:00Added an answer on May 18, 2026 at 11:16 am

    Use the ‘inserted‘ table:

    CREATE TRIGGER new_trigger_INSERT 
    ON old_table 
    FOR INSERT 
    INSERT INTO new_table (id, first_name, last_name) 
    SELECT col1, col2, col3 FROM inserted
    

    [PS: Don’t forget to ensure your triggers handle multiple rows…]

    Ref. Create Trigger

    Good article: Exploring SQL Server Triggers

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

Sidebar

Related Questions

I have two SqlDataSource controls on a page. One loads high level data and
I have to use CoreData based database to store my data. At high-level my
High Level With StructureMap, Can I define a assembly scan rule that for an
This is for some high level Web/Rest tests of my whole system that are
I have related data living on two completely separate databases, and I need information
I have an ImagesController that kicks off a non-trivial save operation. Here's the high-level
I have a Django project that has two models: Group and Person. Groups can
Here's my problem at a high level: We have two business applications. App1 inputs
I’m working on a project and have developed the high level user requirements for
I find that many high level functions are missing in most well-known javascript libraries

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.