如何在一个表中插入从整个数据库中删除的数据? [英] How to insert the data deleted out of the entire database in a single table?

查看:61
本文介绍了如何在一个表中插入从整个数据库中删除的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将整个数据库中删除的数据插入一个表中?

我读到你可以用触发器做但我没有一个例子,有人可以帮助我

How to insert the data deleted out of the entire database in a single table?
I read that you can do with a trigger but I have not an example, someone who can help me please

推荐答案

在SQL中,您可以在数据库级别创建的触发器是关于DDL(数据定义语言)。

所以如果你不想处理来自不同表的删除必须为所有表添加触发器。

关于写入 - 您将遇到不同表中不同列的问题。一种解决方法是在目标表上使用XML ...
In SQL the triggers you can create on database level are about DDL (Data Definition Language).
So if you wan't to handle deletions from different tables you must add trigger to all of them.
About the writing - you will have the problem of different columns in different tables. One way to solve is using XML on the target table...


这篇关于如何在一个表中插入从整个数据库中删除的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆