Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql server kill all connections

USE [master];

DECLARE @kill varchar(8000) = '';  
SELECT @kill = @kill + 'kill ' + CONVERT(varchar(5), session_id) + ';'  
FROM sys.dm_exec_sessions
WHERE database_id  = db_id('MyDB')

EXEC(@kill);
Comment

PREVIOUS NEXT
Code Example
Sql :: log queries postgre 
Sql :: .... ERROR! The server quit without updating PID file mysql centos 
Sql :: alter schema sql 
Sql :: his is incompatible with sql_mode=only_full_group_by 
Sql :: postgres change the name of schema 
Sql :: how to drop databaselink in oracle 
Sql :: dbms_output sql developer 
Sql :: mysql server does not start mac 
Sql :: wordpress sql find and replace 
Sql :: mysql modify foreign key 
Sql :: psql get sequences 
Sql :: sql drop view if exists 
Sql :: oracle show running job 
Sql :: how to check when a stored procedure was last modified in sql server 
Sql :: mysql list users on ubuntu 
Sql :: oracle current date without time 
Sql :: add super privilege mysql 
Sql :: oracle to date 
Sql :: import mysql dump command line windows 
Sql :: oracle cpu per session 
Sql :: oracle alter sequence restart start with 
Sql :: what is meant by trigger in dbms 
Sql :: check database size sql 
Sql :: sqlite create integer column with limit 
Sql :: mysql show table column full description 
Sql :: postgres check blocking 
Sql :: oracle list index on table 
Sql :: update substring in mysql 
Sql :: xampp mysql database server is not starting mac m1 
Sql :: user privileges postgresql information_schema 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =