السلام عليكم ورحمته الله وبركاته
ما الخا فى هذا الstored حيث انه يظهر الخطا التالى ولا ادارى ما سببه
ALTER PROCEDURE [dbo].[insertamount11] -- Add the parameters for the stored procedure here @emp_id int, @start datetime, @price decimal (7,3), @end datetime, @num int, @mony decimal (5,3), @name1 int AS BEGIN SET NOCOUNT ON; DECLARE @S Int INSERT INTO amount1 VALUES (@emp_id,@start, @price, @end, @num, @mony, @name1) SET @S = (SELECT dbo.amount1.num FROM dbo.amount1 WHERE emp_id = @emp_id AND start = @start) WHILE @S > 0 BEGIN INSERT INTO childamount VALUES (@emp_id,@mony,dateadd(mm,1,@start)) SET @S = @S - 1 end END
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.