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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:11:54+00:00 2026-05-31T20:11:54+00:00

Overview: Trying to write a trigger for a SQL Server 2008 database. TableA and

  • 0

Overview: Trying to write a trigger for a SQL Server 2008 database. TableA and TableB have the same schema.

Aim: On an insert into TableA, copy everything in that row to a new row in TableB

Notes so far:

Using this question I manage to get most the way, but then stumbled into a problem with

Cannot use text, ntext, or image columns in the ‘inserted’ and
‘deleted’ tables.

I just have text columns, but I want to copy them too.

I found this website which seems to have a workaround but, it is working on update, and I haven’t been able to apply it to my insert example…

Any ideas?

Edit: purpose is to add functionality to an existing product, I can’t change schema of TableA unfortunately.

  • 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-31T20:11:55+00:00Added an answer on May 31, 2026 at 8:11 pm

    I’m not sure why you can’t use the example you linked to. It should be as simple as:

    CREATE TRIGGER T_TableA_I
    on TableA
    after insert
    as
        set nocount on
    
        insert into TableB (ColumnA,ColumnB,/* Columns in table b */)
        select a.ColumnA,a.ColumnB, /* Columns from table a */
        from
            TableA a
                inner join
            inserted i
                on
                    a.PKColumn1 = i.PKColumn1 and
                    a.PKColumn2 = i.PKColumn2 /* Primary Key columns from table A */
    

    Of course, your question doesn’t contain any table definitions, so the above will need quite a bit of modification. Hopefully, you can work out what to add/remove from the above, where comments exist.

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

Sidebar

Related Questions

I am trying to write an ajax web app. I have a function that
Quick overview Trying to insert a Business Object using ObjectDataSource (on a GridView) Get
I am trying to edit the same text (which I have stored in a
Here is the overview of what I am trying to do. I have a
Overview I am trying to get a photo feed on to my site using
Just before I begin heres a small overview of what I'm trying to achieve
Overview I have an iOS project which contains 2 navigation controllers as shown in
Problem Overview: My application has an enrollment form. Users have a habit of entering
I have a overview page containing a list with some links from which multiple
Overview: I am trying to avoid a race condition with accessing an IndexedDB from

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.