INSERT INTO after get auto-insert Id:select @ @IDENTITY as ID
If SQL Server is best with select Scope_identity () as ID
Because @ @identity a global
The same kind of ident_current (' table ')
Ident_current returns the identity value that was last generated for any session and for a particular table in any scope. Ident_current is not subject to scope and session restrictions, but is limited to the specified table. Ident_current returns the value generated for a specific table in any session and scope.
@ @IDENTITY Returns the identity value that was last generated for any table in all scopes of the current session.
Scope_identity returns the identity value that was last generated for the current session and any tables in the current scope
The scope_identity and @ @IDENTITY return the last identity value generated within any table in the current session. However, scope_identity only returns the value inserted into the current scope, and the @ @IDENTITY is not restricted to a specific scope.
MyBatis's MySQL Insert