How can I kill a running session in SQL Azure?

Отвечено How can I kill a running session in SQL Azure?

  • 9 марта 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

Все ответы

  • 9 марта 2012 г. 22:10
     
     Предложенный ответ

    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

    • Предложено в качестве ответа DamPee 9 марта 2012 г. 22:39
    •  
  • 9 марта 2012 г. 22:23
     
     Отвечено

    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

    • Помечено в качестве ответа Katy Leonard 9 марта 2012 г. 23:08
    •  
  • 10 марта 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.