Home > Back-end >  Performing a loop in SQL Server query
Performing a loop in SQL Server query

Time:07-27

Good morning, what do I have to change in this code to execute a loop that will execute the query as many times as number of rows in the csv file and will increase the 'i' index and with each execution?

Picture of code

CodePudding user response:

I assume filecontent is a list. In this case, try to replace your while loop with that:

for i in range(len(filecontent)):
    sql = ...

Please make sure to remove i=i 1 line from the end of your loop.

  • Related