由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - Trigger questions
相关主题
trigger vs. log ?SQL Server Trigger on System Base Table or Catalog View
Help on Sql server huge table performance急问一个奇怪的sql server数据库问题
how to include record deleted date into trigger?question: copy first N rows from table B to table A (DB2)
database triggers谁能帮我看看这个sql query的优化
如何让SQL 2005 CLR Trigger返回结果给Stored Procedure用?oracle: cartesian product warning
面试问题How would you improve table insert performance? (give five or more ideas)How to split a column into several rows?
why this Trigger hang the Process *** thanks thanksBulk merge? (转载)
求教:Oracle trigger 中生成的数据如何送到stored procedure中?MySQL 的一个问题求教
相关话题的讨论汇总
话题: trigger话题: table话题: deleted话题: temp话题: rows
进入Database版参与讨论
1 (共1页)
k******r
发帖数: 2300
1
I want to write a trigger. Whenever someone tries to delete the rows of a
table, then the trigger will be fired and those deleted rows will be inserted
into a temp table. In addition, the temp table also need a column to record
the date and time when each row is deleted. Please give me some advices.
Thanks a lot!
aw
发帖数: 127
2
if you're using SQL Server.
CREATE TRIGGER [TRIGGER NAME] ON [table_name]
FOR DELETE
AS
INSERT INTO TEMP_TABLE
SELECT *, current_timestamp FROM Deleted
Deleted is a system virtual table in SQL server.

inserted

【在 k******r 的大作中提到】
: I want to write a trigger. Whenever someone tries to delete the rows of a
: table, then the trigger will be fired and those deleted rows will be inserted
: into a temp table. In addition, the temp table also need a column to record
: the date and time when each row is deleted. Please give me some advices.
: Thanks a lot!

k******r
发帖数: 2300
3
Thanks a lot!

record

【在 aw 的大作中提到】
: if you're using SQL Server.
: CREATE TRIGGER [TRIGGER NAME] ON [table_name]
: FOR DELETE
: AS
: INSERT INTO TEMP_TABLE
: SELECT *, current_timestamp FROM Deleted
: Deleted is a system virtual table in SQL server.
:
: inserted

1 (共1页)
进入Database版参与讨论
相关主题
MySQL 的一个问题求教如何让SQL 2005 CLR Trigger返回结果给Stored Procedure用?
oracle trigger question面试问题How would you improve table insert performance? (give five or more ideas)
No Need for trigger Re: oracle trigger questionwhy this Trigger hang the Process *** thanks thanks
MySQL Server 2k Question again!求教:Oracle trigger 中生成的数据如何送到stored procedure中?
trigger vs. log ?SQL Server Trigger on System Base Table or Catalog View
Help on Sql server huge table performance急问一个奇怪的sql server数据库问题
how to include record deleted date into trigger?question: copy first N rows from table B to table A (DB2)
database triggers谁能帮我看看这个sql query的优化
相关话题的讨论汇总
话题: trigger话题: table话题: deleted话题: temp话题: rows