Home > database >  Consult multiple clients to SQL time-consuming data is submitted at the same time, how do deal with
Consult multiple clients to SQL time-consuming data is submitted at the same time, how do deal with

Time:03-11

A table field: address (text)
B table fields: address (text)

Client submit data have 2 kinds of stored procedures,
A: is it to A new data table, and then check whether these new data already exists in table B, if any, marking;
Two: is new data to the table B, then check whether these new data already exist on A table, if you have, marking;

Program is currently single thread, the first kind of behavior, and the second kind of behavior does not occur at the same time, if to multithreading submitted at the same time, because it is a time-consuming operation, the data will be disorder, such as:
Execute the stored procedure at 9:00, 9:06 is expected to complete,
In that the execution of the stored procedure two, it is expected to complete, than the stored procedure is a late start, but early end,

Is that will be in the process to table A new data due to the execution process of two haven't finished writing, hasn't been process two than to?
Record the result leads to actually exist in table A, but I don't have to make A mark?

CodePudding user response:


You can wrap up two stored procedures in a new stored procedure execution

CodePudding user response:

reference 1st floor shoppo0505 response:
can
You can wrap up two stored procedures in a new stored procedure that executes
if the fit, multiuser execute the stored procedure at the same time, there will be data was not compared to you?

CodePudding user response:

Suggest you look at my blog:
https://blog.csdn.net/yenange/article/details/78903480

CodePudding user response:

refer to the second floor Chinese naming advocates response:
Quote: refer to 1st floor shoppo0505 response:
can
You can wrap up two stored procedures in a new stored procedure that executes
if the fit, multiuser execute the stored procedure at the same time, there will be data was not compared to you?

If in a stored procedure, the command in the batch (the begin, end) should be no problem,
  • Related