Sending Result Sets to the Server (Extended Stored Procedure API)

Applies to: SQL Server

Important

This feature will be removed in a future version of SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use CLR Integration instead.

When sending a result set to Microsoft SQL Server, the extended stored procedure should call the appropriate API as follows:

  • The srv_sendmsg function may be called in any order before or after all rows (if any) have been sent with srv_sendrow. All messages must be sent to the client before the completion status is sent with srv_senddone.

  • The srv_sendrow function is called once for each row sent to the client. All rows must be sent to the client before any messages, status values, or completion statuses are sent with srv_sendmsg, the srv_status argument of srv_pfield, or srv_senddone.

  • Sending a row that has not had all its columns defined with srv_describe causes the application to raise an informational error message and return FAIL to the client. In this case, the row is not sent.

See Also

Creating Extended Stored Procedures