---
title: "Discussion on \"SQL: Generate Kill Command\" | Hashnode"
description: "Discussion on \"SQL: Generate Kill Command\". This handy SQL query list all connections to an mssql database and a corresponding kill command. The kill command will just be printed, not executed.\nDECLARE @database_name NVARCHAR(255);\nSET @database_name = 'name of database'\nSELECT\n    DB_NAME(dbi..."
url: "https://hashnode.com/posts/sql-generate-kill-command/6461bbbbbabd05f5acd02189"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [SQL: Generate Kill Command](https://thim.hashnode.dev/sql-generate-kill-command?utm_source=hashnode&utm_medium=feed)

This handy SQL query list all connections to an mssql database and a corresponding kill command. The kill command will just be printed, not executed. DECLARE @database\_name NVARCHAR(255); SET @database\_name = 'name of database' SELECT DB\_NAME(dbi...

May 15, 2023 · 1 min read · thim.hashnode.dev  
Read the article

-   [#mssql](https://hashnode.com/tag/mssql)

## Written by

[Thim Nilsson](https://hashnode.com/@thimnilsson)

@thimnilsson

  
[View profile](https://hashnode.com/@thimnilsson)

sysadmin

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
