Home > database >  Inadvertently found a strange problem, insert into successful, open the table there is no record
Inadvertently found a strange problem, insert into successful, open the table there is no record

Time:01-01


I am in the process of storage, the log table insert into records, statement execution is successful, then also use the select query also recorded,

The insert into statement is not in the transaction, after the execution of the this an inset into statements, will return to the stored procedure is a transaction

But open the table directly, or have other select queries, but not just insert record

If ShouGong add a record to the table, then the ID will have one more, that already has a record exists,


Statement format is as follows:

 

If (a> 1)
The begin
Insert into logtabe value () ()
Select * from logtabe - can display just insert record

Select 'log into success -- you can display correctly this statement

Return
End

- start transaction -
The BEGIN tran trInfoLog

- other transaction

Commit tran trInfoLog




After the above code execution, to open the table, but not just inserted record
  • Related