In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article shows you how to implement triggers and cursors in sqlserver. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
The code is as follows: Create trigger tri_wk_CSVHead_History on wk_CSVHead_History-declares a tri_wk_CSVHead_History trigger Instead of insert-the insert operation is replaced by performing the following operation as begin declare YB cursor-- declare a cursor for select NoteNO from inserted-- where the NoteNO will match the following open YB declare @ NoteNO varchar (50)-- where the NoteNO will match the above, and define a cursor variable @ NoteNO to manipulate the NoteNo in the insered table. Fetch next from YB into @ NoteNO-- if the NoteNO here matches above, move the cursor while (@ @ fetch_status=0)-- 0 operation succeeded,-1 FETCH statement failed or the row is not in the result set,-2 the extracted row does not exist begin delete from wk_CSVDetail_History where NoteNO=@NoteNO delete from wk_CSVHead_History where NoteNO=@NoteNO fetch next from YB into @ NoteNO-- continue to move the cursor Until @ @ fetch_status is not equal. End close YB-- close the cursor deallocate YB-- release the cursor insert into wk_CSVHead_History select * from inserted end
The above is how to implement triggers and cursors in sqlserver. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are 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.