2.2.7.6 DONE
Token Stream Name:
-
DONE
Token Stream Function:
Indicates the completion status of a SQL statement.
Token Stream Comments
The token value is 0xFD.
This token is used to indicate the completion of a SQL statement. As multiple SQL statements can be sent to the server in a single SQL batch, multiple DONE tokens can be generated. In this case, all but the final DONE token has a Status value with DONE_MORE bit set (details follow).
A DONE token is returned for each SQL statement in the SQL batch except variable declarations.
For execution of SQL statements within stored procedures, DONEPROC and DONEINPROC tokens are used in place of DONE tokens.
Token Stream-Specific Rules:
-
TokenType = BYTE Status = USHORT CurCmd = USHORT DoneRowCount = LONG / ULONGLONG; (Changed to ULONGLONG in TDS 7.2)
The type of the DoneRowCount element depends on the version of TDS.
Token Stream Definition:
-
DONE = TokenType Status CurCmd DoneRowCount
Token Stream Parameter Details:
Parameter |
Description |
---|---|
TokenType |
DONE_TOKEN |
Status |
The Status field MUST be a bitwise 'OR' of the following:
|
CurCmd |
The token of the current SQL statement. The token value is provided and controlled by the application layer, which utilizes TDS. The TDS layer does not evaluate the value. |
DoneRowCount |
The count of rows that were affected by the SQL statement. The value of DoneRowCount is valid if the value of Status includes DONE_COUNT.<45> |