July 2023 1 8 Report
CREE ESTOS TRIGGERS DE SQL SERVER, QUISIERA SABER SI ESTAN MAL O BIEN Y EN QUE DEBO CORREJIRLOS DEN EJEMPLOS EJECUTABLES, GRACIAS

/*==============================================================*/
/* Table: iNSERTAR */
/*==============================================================*/

create trigger insertarProducto
on producto
for insert
as
print 'Se inserto un nuevo registro en la tabla producto'

go

insert
into Producto values ('1233','2.50','45')




/*==============================================================*/
/* Table: ELIMINAR */
/*==============================================================*/

create trigger eliminarProducto
on producto
for delete
as
print 'Se eliminó un registro en la tabla producto'

go

delete
from Producto where id_Producto = '1234'





/*==============================================================*/
/* Table: ACTUALIZAR */
/*==============================================================*/
create trigger actualizarProducto
on producto
for update
as
print 'Se actualizo un registro en la tabla producto'

go

update Producto set Precio_Uni= '0.80',Stock= '54'
where id_Producto = '1233'

Life Enjoy

" Life is not a problem to be solved but a reality to be experienced! "

Get in touch

Social

© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.