In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
In this article, we will learn how to use triggers in sql. There is a certain reference value, friends in need can refer to, hope to help you.
The use of triggers
A trigger is a special stored procedure that executes automatically when a user attempts to execute a specified data modification statement on a specified table. You can use CREATE statements to create triggers, DROP statements to delete triggers, ALTER statements to disable triggers, and so on. Next, let's introduce it in detail.
Create trigger
CREATE TRIGGER tr_update_Stock
Delete trigger
DROP TRIGGER tr_update_Stock
Forbidden
ALTER TABLE trig_example DISABLE TRIGGER trig1GO
Restore
ALTER TABLE trig_example ENABLE TRIGGER trig1GO
Disable all triggers on a table
ALTER TABLE, your watch, DISABLE TRIGGER all.
Enable all triggers on a table
ALTER TABLE, your watch, enable TRIGGER all.
Disable all triggers on all tables
Exec sp_msforeachtable 'ALTER TABLE? DISABLE TRIGGER all'
Enable all triggers on all tables
Exec sp_msforeachtable 'ALTER TABLE? enable TRIGGER all'
The above is a brief introduction to the use of triggers in sql, of course, the detailed use of the above differences have to be used by everyone to understand. If you want to know more, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.