Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kill all user connections in SQL Azure

Tags:

sql

azure

I need to alter a table and the Sql Azure just spins its wheels.

I think its because there is a connection somewhere that is accessing that table.

How can I see who is accessing my tables and how can I terminate their connections.

I am looking for something similar to

ALTER DATABASE xxx SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO

that will work with sql azure

like image 864
Rabbi Avatar asked Sep 27 '10 03:09

Rabbi


2 Answers

You can use sys.dm_exec_connections to view information about connections to a SQL Azure DB. Example here under Monitoring Connections. You could block the errant connections at the SQL Firewall level or deny them access to the table you care about with the security stored procedures.

like image 128
JP Alioto Avatar answered Oct 14 '22 06:10

JP Alioto


Any valid alter database should drop connection. For instance, you can change the size ALTER database demo MODIFY (MAXSIZE=5 GB)

like image 36
benjguin Avatar answered Oct 14 '22 08:10

benjguin