ct_results sets result_type to CS_CMD_DONE to indicate that the results of a logical command have been completely processed. A logical command is any command defined using ct_command, ct_dynamic, or ct_cursor, with the following exceptions:
Each Transact-SQL select statement that returns data inside a stored procedure is a logical command. Other Transact-SQL statements inside stored procedures do not count as logical commands (including select statements that assign values to local variables).
Each Transact-SQL statement executed by a dynamic SQL command is a distinct logical command.
Each Transact-SQL statement in the text of language command is a logical command.
Logical commands and Client-Library commands are not equivalent. A Client-Library command can execute multiple logical commands on the server, for example, a stored procedure can execute multiple select statements that return data, and each such statement represents one logical command. A logical command can generate one or more result sets; for example, a select statement can return multiple regular-row and compute results sets.