I am using stored procedure to update the data in a table on azure database. the table name is "demo_output" Code for stored procedure -
CREATE PROCEDURE demo_Insertdatainto_table
@Model int, @output float , @batchid int
AS
BEGIN
INSERT INTO [dbo].[demo_output](
model, output, batchid)
VALUES(@model, @output, @batchid)
END
Consider I have a dataframe as df. In order to insert values in the table I have to iterate through the data on stored procedure. But it take lot of time to insert the values. Please suggest a solution which can insert values in the table faster. Currrent code I am using to update the table -
for index, row in df.iterrows():
cursor.execute('exec demo_Insertdatainto_table ?,?,?', [row.Model, row.output, row.batchid])
cursor.commit()