Is there a way in SQL to ask “what has changed?”?

Often I find myself working on a new project with a giant RDBMS, whose schema I still do not understand. I want to be able to mark a checkpoint in the database, do something in the application, and then go back to the database and ask which tables have changed (and ideally, which records have changed).

Is there a way to do something similar with SQL? I found this one , but it is only MSSQL (which I do not use).

No need to be super effective. It will just be in my dev block, and I can wait a few seconds if necessary, but I'm looking for something better than "dropping the entire database twice and distinguishing the results."

+3
source share
6 answers

If your DBMS supports query logging, enable it and write it to the log.

+2
source

SQL Server and Oracle have a feature that you can activate called "Change Data Capture". You said you weren’t using SQL Server, but there is still hope if you work in Oracle. Perhaps you should indicate which dbms you are using.

+2
source

- - MySQL, .

, , SQL. ( .SQL .CSV ?)

0
  • , .
  • , .
  • or if it supports logging out. (I think ODBC on Windows supports this.)
0
source

It's best to see if your RDBMS is a proprietary function that does this, or add update triggers that will log events.

0
source

In mysql i use column

modified timestamp

to get the lines that changed

0
source

Source: https://habr.com/ru/post/1703007/


All Articles