si è vero
pero' ho fatto tabelle divise per ogni reception
in quanto non voglio assolutamente che si verifichi una sovrapposizione di dati se delle funzioni insert/update venissero lanciate nel medesimo istante
mi e' capitato in passato
si è vero
pero' ho fatto tabelle divise per ogni reception
in quanto non voglio assolutamente che si verifichi una sovrapposizione di dati se delle funzioni insert/update venissero lanciate nel medesimo istante
mi e' capitato in passato
victor
----------------------
comunque parte l'accapo come suggerito, invece di
codice:dim lasele as string=" Select * from reception_0 where tessera >="& datainizio2 &" and tessera <="& datafine2 &" " lasele=lasele & " union Select * from reception_1 where tessera >="& datainizio2 &" and tessera <="& datafine2 &" "
puoi scrivere
codice:dim lasele as string=" Select * from reception_0 where tessera >="& datainizio2 &" and tessera <="& datafine2 &" " lasele += " union Select * from reception_1 where tessera >="& datainizio2 &" and tessera <="& datafine2 &" " lasele += " union Select * from reception_2 where tessera >="& datainizio2 &" and tessera <="& datafine2 &" " ......
Ultima modifica di djciko; 27-07-2020 a 09:30
press play on tape
-----
MP3 Listing
https://sourceforge.net/projects/mp3-listing
File Listing
https://sourceforge.net/projects/file-listing-2-0/
in realta' in Update puo' andare in confusione quando si verifica concorrenza (operazioni onerose in un altro thread).
per evitarla, c'è l'istruzione With NOLOCK che fa in modo da prendere il valore ignorando i cambiamenti in corso da altri
https://docs.microsoft.com/en-us/sql...l-server-ver15
(cerca "READUNCOMMITTED")
press play on tape
-----
MP3 Listing
https://sourceforge.net/projects/mp3-listing
File Listing
https://sourceforge.net/projects/file-listing-2-0/
Non ti è più facile comporre la stringa sql in questo modo?
codice:Dim sb As New StringBuilder() sb.AppendFormat("Select * from reception_{0} where tessera >= {1} and tessera <= {2}", 0, datainizio2, datafine2) For i As Integer = 1 To 7 sb.AppendFormat(" union Select * from reception_{0} where tessera >= {1} and tessera <= {2}", i, datainizio2, datafine2) Next sb.Append(" order by tessera desc, datas desc ") Dim sql As String = sb.ToString
Ultima modifica di djciko; 29-07-2020 a 12:03
Pietro