What is best when you update from one asp-page several tables in two
different databases when it concerns performance:
- to use several simple Execute-commands like these:
conn.Execute "UPDATE F9999.dbo.Prod SET " & _
"Descr = '" & Request.Form("Descr") & "' " & _
"WHERE ((ProdNo)='" & Request.Form("ProdNr") & "')"
conn.Execute "UPDATE Produkt SET " & _
"Benamn2 = '" & Request.Form("Benamn2") & "' " & _
"WHERE ((ProdNr)='" & Request.Form("ProdNr") & "')"
conn.Execute "UPDATE PrBok SET " & _
"PrInfo = '" & Request.Form("PrInfo") & "', " & _
"SidAntal = '" & Request.Form("SidAntal") & "' " & _
"WHERE ((ProdNr)='" & Request.Form("ProdNr") & "')"
- to use one more complex Execute-command like this:
conn.Execute "UPDATE F9999.dbo.Prod INNER JOIN (PrBok INNER JOIN Produkt ON
PrBok.ProdNr = Produkt.ProdNr) ON F9999.dbo.Prod.ProdNo = Produkt.ProdNr
SET F9999.dbo.Prod.Descr = "aaa", Produkt.Benamn2 = "bbb", PrBok.PrInfo =
"ccc", PrBok.SidAntal = "ddd" & _
"WHERE ((ProdNr)='" & Request.Form("ProdNr") & "')"
Please note: The two examples do not fully correspond. For example, all
"aaa" etc should be changed to '" & Request.Form("Descr") & "' " etc. But I
think you will understand my point.
Bengt