SQL Server數據庫觸發器插入數據實例


1 use test--用於哪個數據庫
2 go
3 create trigger trig_test1 --創建觸發器名稱
4 on tb_test--用於哪張表
5 after insert --在插入數據之后做的動作
6 as 
7 update tb_test set test1='ok'
8 where ID in (select ID from inserted)
9 go

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM