<p>I have a client-server architecture where client communicates with the server using .NET Remoting. Server handles all business logic and database interaction. I need to add an operation which may take a while to execute and the dataset it returns might be quite large. I'm thinking of employing asynchronous call for that. Now the problem arises: assume, the client made this async call, operation started SQL query, and user either closes the client or clicks Cancel -- what will happen to the operation? Is there any way to cancel the pending async call, which is busy talking to SQL server?</p>

<p>Thanks.</p>

You could design your client/server interaction so that the server let a worker thread do the SQL stuff so that it was ready to receive another call from the client.   So, the client makes call 1 and says do SQL work.   The server gives that work to the worker thread and is ready for new incoming.   Then the client makes call 2 and says, "never mind".  The server would do some bookkeeping to make sure it doesn't call back to the client when the worker thread is done.
Can the server safely interrupt the worker thread.  I'm not sure.   Would that have any affect on what SQL Server is doing.   Not sure.