Hello All!
I'm executing the below code as part of a larger procedure and it's taking ~3-4 mins to complete which feels lengthy.
I'm wondering if there is a more efficient approach that I could use or if this time would be usual for itterating through ~100 update statements?
CurrentDb = linked tables to Azure SQL Server via ODBC Driver 17 for SQL Server.
TrayQty = 105 (typically)
Any help appreciated
I'm executing the below code as part of a larger procedure and it's taking ~3-4 mins to complete which feels lengthy.
I'm wondering if there is a more efficient approach that I could use or if this time would be usual for itterating through ~100 update statements?
CurrentDb = linked tables to Azure SQL Server via ODBC Driver 17 for SQL Server.
TrayQty = 105 (typically)
Code:
For i = 1 To TrayQty
uSQL = "UPDATE [Element Weighing] SET " & _
"[Final Melts By] = '" & Me.[Operator].Value & "', " & _
"[Date of Final Melts] = #" & Format(Date, "yyyy-mm-dd") & "#, " & _
"[Retaining Cap] = '" & uDataSet(i, 1) & "', " & _
"[Spacer Washer] = '" & uDataSet(i, 2) & "', " & _
"[Mounting Frame] = '" & uDataSet(i, 3) & "' " & _
"WHERE [Unique Ref] = '" & Me.[Order_Number].Value & "-" & Me.[Tray_ID].Value & "-" & i & "';"
CurrentDb.Execute uSQL
Next i
Any help appreciated