SQL Server中的触发器 [英] Triggers in SQL Server

查看:92
本文介绍了SQL Server中的触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



你能告诉我sql server中触发器的优缺点吗?



我已经通过了一些链接。



但是,我需要一些明确的解释。



请回复我。



问候,



Ragamaie

Hi Friends,

Could you please tell me the advantages and disadvantages of triggers in sql server?

I have already gone through some links.

But, I need some clear explanation.

Please reply me.

Regards,

Ragamaie

推荐答案

我知道你已经通过了链接,但请检查一下。



http://www.mysqltutorial.org/sql-triggers.aspx [ ^ ]



简洁明了,重点突出!一个很好的起点。
I know you have gone through links, but check this.

http://www.mysqltutorial.org/sql-triggers.aspx[^]

Its short and concise and to the point! A good starting place.


检查一下:



触发器 - Sql Server [ ^ ]



希望它有帮助:)
check this out:

Triggers -- Sql Server[^]

hope it helps :)


触发器的缺点(问题)



很容易在数据库中查看表关系,约束,索引,存储过程但很难查看触发器。

触发器执行不可见客户端应用程序。它们不可见或可以在调试代码中跟踪。

很难遵循它们的逻辑,因为它们可以在数据库插入/更新发生之前或之后被触发。

很容易忘记触发器,如果​​没有文档,就很难找出新开发人员的存在。

每次更新数据库字段时都会触发触发器在系统上。它使系统运行速度变慢。
Disadvantages(Problems) of Triggers

It is easy to view table relationships , constraints, indexes, stored procedure in database but triggers are difficult to view.
Triggers execute invisible to client-application application. They are not visible or can be traced in debugging code.
It is hard to follow their logic as it they can be fired before or after the database insert/update happens.
It is easy to forget about triggers and if there is no documentation it will be difficult to figure out for new developers for their existence.
Triggers run every time when the database fields are updated and it is overhead on system. It makes system run slower.


这篇关于SQL Server中的触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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