Código SQL
[-]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)
bueno este largo Stored Preocedure :d resulta si solo le envio 1 elemento, pero si existe mas de 1 me da un error tal como "
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression." me gustaria saber si alguien sabe como resolver este problema. cualquier duda del codigo pregunten