How can I kill a running session in SQL Azure?

Respondida How can I kill a running session in SQL Azure?

  • viernes, 09 de marzo de 2012 21:18
     
     
    How can I kill a session in SQL Azure?  I started a data scrub in a database which I know is not going to complete, because our sevice is still running and adding more data to the table.  Since there is no KILL support in SQL Azure, how do I kill the session?  Note that the SSMS window has already (inadvertently) been closed.

    Katy Lynn McCullough-Leonard

Todas las respuestas

  • viernes, 09 de marzo de 2012 22:10
     
     Respuesta propuesta

    If you open up a support case, CSS can get the KILL command executed (https://support.microsoft.com/oas/default.aspx?gprid=14919&st=1&wfxredirect=1&sd=gn).  However, an easier solution might be to issue an ALTER DATABASE command and temporarily change the database name.  This name change will cause SQL Azure to terminate all active sessions, thus terminating this command.

    Evan

    • Propuesto como respuesta DamPee viernes, 09 de marzo de 2012 22:39
    •  
  • viernes, 09 de marzo de 2012 22:23
     
     Respondida

    Thanks Evan!  This is good to know (both the support option and the trick of renaming the DB).  Thankfully, I got operations to stop the running service, so the data scrub finally completed on its own.  (This falls under the "if you wait long enough, the problem will fix itself" category.)  But, is there a reason why there is no DB-specific KILL equivalent in SQL Azure?  It it were scoped to only apply to one's own database, one could only mess up one's own data.


    Katy Lynn McCullough-Leonard

    • Marcado como respuesta Katy Leonard viernes, 09 de marzo de 2012 23:08
    •  
  • sábado, 10 de marzo de 2012 0:04
     
     

    It's just a function of too many features and not enough time.  As you may or may not know, SQL Azure is running SQL Server 2012 under the covers but we intentionally have locked out anything that we are not 100% is safe in a multi-tenant environment.  At this point in time, KILL falls in this category. 

    That being said, adding a KILL command for use in SQL Azure is high on our list.