7

I have a system-versioned table in sql server 2016. I want to store Modifier ID in its temporal (history) table while users are performing delete or update action on the table.

Is there any built-in solution by sql server 2016 to do that?

2 Answers 2

4

You can use Audit

Introduction to sql server 2008 audit

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

Comments

4

No it is not possible because the Temporal tables and their History tables has to have exactly the Same Schema i.e

  • number of columns
  • column names
  • data types
  • and even the ordering of the columns

So unless you are capturing the Modifier's ID in the Temporal tables itself, you cannot add this information to the history table.

How would you capture this Modifier's ID information in the Temporal table itself, well this can be handled on the application layer.

1 Comment

That's a drawback for me. They can at least add an option to mark such column as hidden from the original table (like the period columns),

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.