Trigger有什么用? [英] what is the use of Trigger
本文介绍了Trigger有什么用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以通过示例
解决方案
告诉我sql中触发器和游标的用途是什么?通过这些链接:
http://plsql-tutorial.com/plsql-cursors.htm [ ^ ]
http ://www.dotnet-tricks.com/Tutorial/sqlserver/OJ97170312-Different-Types-of-SQL-Server-Triggers.html [ ^ ]
询问 Google [ ^ ]
关于70, 10,000
结果(0.20秒)
。
这里有一些非常好的文章在触发器。
检查:
触发器 - SQL Server [ ^ ]
http:// www.sqlteam.com/article/an-introduction-to-triggers-part-i [ ^ ]
http://msdn.microsoft.com/en-us/library/ms189799.aspx [ ^ ]
在发布另一个问题之前,请Google [<小时ef =https://www.google.co.in/\"target =_ blanktitle =新窗口> ^ ]请先阅读
代码项目快速解答常见问题解答 [ ^ ]
触发器在插入时触发,更新,删除statemet执行
例如:
如果我们有桌子名称:t1
如果我们计算总和并在插入t1时在另一个表t2中更新,
例如:
CREATE OR REPLACE TRIGGER tr1
BEFORE
insert sampletable
每个 行
=code-leadattribute>开始
SELECT sampletable2 。 id 。 nextval INTO :NEW 。 R_ID FROM dual;
结束;
光标:
sql server中的Cursor是什么 [ ^ ]
Can any one tell me what is the use of trigger and cursor in sql with example
解决方案
go through these links:
http://plsql-tutorial.com/plsql-cursors.htm[^]
http://www.dotnet-tricks.com/Tutorial/sqlserver/OJ97170312-Different-Types-of-SQL-Server-Triggers.html[^]
Ask Google[^]
About70,10,000
results in(0.20 seconds)
.
Here are some very good articles on Trigger.
Check this:
Triggers -- SQL Server[^]
http://www.sqlteam.com/article/an-introduction-to-triggers-part-i[^]
http://msdn.microsoft.com/en-us/library/ms189799.aspx[^]
Before posting another question ask Google[^] first and please read
Code Project Quick Answers FAQ[^]
trigger fires when insert,Update ,delete statemet execute
eg:
if we have table name : t1
if we calculate the sum and updated in another table t2 when insert into t1 occurs,
eg:
CREATE OR REPLACE TRIGGER tr1 BEFORE insert on sampletable for each row begin SELECT sampletable2.id.nextval INTO :NEW.R_ID FROM dual; end;
cursor:
What is Cursor in sql server[^]
这篇关于Trigger有什么用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文