0
votes

If I submit a series of SQL statements (each with GO in sqlcmd) that I want to make an reasonable attempt to run on an Azure SQL Data Warehouse, I've found in sqlcmd how to ignore errors. But I've seen if I want to abort a statement in that sequence of statements with:

KILL "SIDxxxxxxx"; 

The whole session ends:

 Msg 111202, Level 16, State 1, Server adws_database, Line 1
 111202;Query QIDyyyyyyyyyy has been cancelled.

Is there a way to not end a query session in Azure SQL Data Warehouse? Similar to how postgres's pg_cancel_backend() works?

In postgres the

pg_terminate_backed(<pid>) 

seems to be working similarly to the ADW

KILL 'SIDxxxx' 

command.

1

1 Answers

1
votes

Yes, a client can cancel a running request without aborting the whole session. In SSMS this is what the red square does during query execution.

Sqlcmd doesn't expose any way to cancel a running request, though. Other client interfaces do, like the .NET SqlClient you can use SqlCommand.Cancel()

David