0

In my database, I have a specific request.

For some tables, let's call one Customer, I have a copy of it, let's call it Customer2 that needs to save some changes made on the records of the first one.

So, whenever I add a column to Customer, it needs to be added to the second one.

Since I'm doing it in a lot of tables, I cant simply duplicate the add column script.

I was thinking on using a DDL script for it, but cant seem to find a working solution.

Basically, what I need is to have a trigger, that whenever a table schema is changed, it would replicate the said change to the "copy" table.

Thanks in advance.

1 Answer 1

1

What you are looking for is a DDL ("data definition language") trigger. You can specify such a trigger on alter table -- to capture when a new column is added.

The place to start is the documentation.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.