<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SQL Server Administration on SQL Server Scripts</title><link>https://www.sqlserver70.com/categories/sql-server-administration/</link><description>Recent content in SQL Server Administration on SQL Server Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>SQLServer70.com</copyright><lastBuildDate>Sat, 11 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.sqlserver70.com/categories/sql-server-administration/index.xml" rel="self" type="application/rss+xml"/><item><title>SQL Server Kill Sessions: Filtered SPID Management</title><link>https://www.sqlserver70.com/post/sql-server-kill-all-connections-to-a-database/</link><pubDate>Sat, 11 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-kill-all-connections-to-a-database/</guid><description>
&lt;h2 id="kill-sql-server-sessions-with-targeted-filters-using-kill-and-dm_exec_sessions"&gt;Kill SQL Server Sessions with Targeted Filters Using KILL and dm_exec_sessions&lt;/h2&gt;
&lt;p&gt;This article covers a practical T-SQL script that kills one or more SQL Server sessions (SPIDs) while giving you precise control over which sessions are targeted. The script uses &lt;code&gt;sys.dm_exec_sessions&lt;/code&gt; to query active sessions and a cursor to issue &lt;code&gt;KILL&lt;/code&gt; commands only against sessions that match your chosen filters.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;When you need to disconnect users from a SQL Server database — whether before taking it offline, restoring it, or clearing stuck sessions — the built-in &lt;code&gt;KILL&lt;/code&gt; command works on one session at a time. Writing a loop to kill many sessions adds complexity. This script wraps that logic into a reusable tool with a safety switch and seven filter parameters so you can scope kills as broadly or narrowly as needed.&lt;/p&gt;</description></item><item><title>SQL Server DBCC CHECKIDENT: Bulk Identity Column Analysis</title><link>https://www.sqlserver70.com/post/sql-server-dbcc-checkident-identity-management-script/</link><pubDate>Sun, 03 Aug 2025 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-dbcc-checkident-identity-management-script/</guid><description>
&lt;h2 id="sql-server-dbcc-checkident-complete-guide-to-identity-column-management-and-bulk-table-analysis"&gt;SQL Server DBCC CHECKIDENT: Complete Guide to Identity Column Management and Bulk Table Analysis&lt;/h2&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;DBCC CHECKIDENT&lt;/code&gt; command is a critical database administration tool in Microsoft SQL Server designed to manage and monitor identity column values. This article explores a practical implementation that demonstrates both individual table identity checking and automated bulk analysis across all user tables in a database.
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;</description></item><item><title>SQL Server Scripts and Commands: DBA Reference All Versions</title><link>https://www.sqlserver70.com/post/sql-server-scripts-database-commands/</link><pubDate>Fri, 01 Aug 2025 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-scripts-database-commands/</guid><description>
&lt;ul&gt;
&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="sql-server-scripts-and-database-commands-65-70-80-90-100-1050-110-120-130-140-150-160-170"&gt;SQL Server Scripts and Database Commands 6.5, 7.0, 8.0, 9.0, 10.0, 10.50, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0&lt;/h2&gt;
&lt;p&gt;The corresponding version numbers and years: SQL Server 6.5 (1996), SQL Server 7.0 (1998), SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012, SQL Server 2014, SQL Server 2016, SQL Server 2017, SQL Server 2019, SQL Server 2022, and SQL Server 2025&lt;/p&gt;
&lt;p&gt;We are in the process of building a list of simple scripts used every day by DBA and others. If you have your own scripts you reuse in a text file on you workstation please send it to us.&lt;/p&gt;</description></item></channel></rss>