Hi,@Analyst_SQL
About this sentence “IF i mentioned Bale_qty 10 ,then 10 row insert into table.”
Do you mean that when the @bale _qty is 10, insert 10 rows of the same data, when the @bale _qty is 5, insert 5 rows of the same data.
If so,please check this:
ALTER PROC dbo.SP_insert_Bale_M
...
AS
BEGIN
INSERT INTO #tbl_Bale_prd
SELECT TOP (@Bale_qty) @bale_id,@item_code,@bale_weight,@Bale_qty,@Bale_Date,@Bale_time,@IpAddress,@empid,@Bale_Type,@Machineno
FROM master.dbo.syscolumns
END
EXEC dbo.SP_insert_Bale_M @Bale_Qty =10
If not, please share us your detailed result.
Best regards,
LiHong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.