update tbl_articulo
set
costo = (select tbl_detalle_nota_entrada.costo from tbl_detalle_nota_entrada
where tbl_articulo.id_articulo = (select tbl_detalle_nota_entrada.id_producto from tbl_detalle_nota_entrada
where tbl_detalle_nota_entrada.id_nota_entrada = @id_nota_entrada )
and tbl_detalle_nota_entrada.id_nota_entrada = @id_nota_entrada),
almacen_1 = almacen_1 + (select tbl_detalle_nota_entrada.cantidad from tbl_detalle_nota_entrada
where tbl_articulo.id_articulo = (select tbl_detalle_nota_entrada.id_producto from tbl_detalle_nota_entrada
where tbl_detalle_nota_entrada.id_nota_entrada = @id_nota_entrada )
and tbl_detalle_nota_entrada.id_nota_entrada = @id_nota_entrada),
almacen_1_fecha = (select tbl_nota_entrada.fecha from tbl_nota_entrada
where tbl_nota_entrada.id_nota_entrada = @id_nota_entrada)
where tbl_articulo.id_articulo = (select tbl_detalle_nota_entrada.id_producto from tbl_detalle_nota_entrada
where tbl_detalle_nota_entrada.id_nota_entrada = @id_nota_entrada)