samedi 27 juin 2015

Msg 512, Level 16, State 1, Procedure trg_pricebase, Line 13 Subquery returned more than 1 value

how to solve this kind of probe help me please:

error:

Msg 512, Level 16, State 1, Procedure trg_pricebase, Line 13 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. The statement has been terminated.


and my trigger is :

ALTER TRIGGER [dbo].[trg_pricebase]
ON  [dbo].[tbl_model2]        
AFTER UPDATE
AS 
   BEGIN

                DECLARE @price_base NVARCHAR(50) = (SELECT tbl_model2.price_base FROM tbl_model2)
                DECLARE @tipid  int = (SELECT tbl_model2.id FROM tbl_model2)


                INSERT INTO tbl_price_history (tbl_price_history.price_base,tbl_price_history.tipid)
                VALUES (@price_base, @tipid )

    END

Aucun commentaire:

Enregistrer un commentaire