This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//utils.sql | |
use BookStore; | |
drop procedure if exists drop_fk; | |
create procedure drop_fk( | |
in tb_name varchar(30), | |
in fk_name varchar(30) | |
)begin | |
if exists(select true from information_schema.table_constraints | |
where table_schema = 'BookStore' and table_name = tb_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--2. Bình luận của một sản phẩm chỉ được đăng sau khi sản phẩm đó được đăng. | |
if OBJECT_ID('utr_cau2a', 'tr') is not null | |
drop trigger utr_cau2; | |
go | |
create trigger utr_cau2a on BINHLUAN | |
instead of insert | |
as begin |