How to task kill the database connection through the cmd prompt.
How to task kill the database connection through the cmd prompt
Hi
You can use the sqlcmd
utility.
sqlcmd -S [server_name] -U [username] -P [password] -Q "KILL [spid]"
Replace [server_name]
with your SQL Server name, [username]
with your SQL Server username, [password]
with your SQL Server password, and [spid]
with the session ID (SPID) of the connection you want to terminate.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.