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.
I’m not sure why you can’t use the example you linked to. It should be as simple as:
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.