integer - SQLServerCentral https://www.sqlservercentral.com The #1 SQL Server community Wed, 14 May 2003 18:45:21 +0000 en-GB hourly 1 https://wordpress.org/?v=6.8.1 Script to kill the top blocker and report what it was doing. https://www.sqlservercentral.com/scripts/script-to-kill-the-top-blocker-and-report-what-it-was-doing https://www.sqlservercentral.com/scripts/script-to-kill-the-top-blocker-and-report-what-it-was-doing#respond Mon, 12 May 2003 18:57:16 +0000 https://www.sqlservercentral.com/?ContentItemID=30800 This script identifies the blocking locks at the top of the blocking chain and kills them. Specifically, it reports what the top blocking spids are doing, kills them, waits three seconds and then reports on current blocking status.  If you have a situation where single connections are causing a huge blocking chain and you want […]

The post Script to kill the top blocker and report what it was doing. appeared first on SQLServerCentral.

]]>
This script identifies the blocking locks at the top of the blocking chain and kills them. Specifically, it reports what the top blocking spids are doing, kills them, waits three seconds and then reports on current blocking status.  If you have a situation where single connections are causing a huge blocking chain and you want to kill the absolute minimum number of spids, then this script is for you.  There is a safety valve in the script to determine the age of the blocks to kill. By default the script kills only the spids at the top of the blocking chain (Thus freeing all blockers and spids below it) if the blocker is older than 5 seconds.

The post Script to kill the top blocker and report what it was doing. appeared first on SQLServerCentral.

]]>
https://www.sqlservercentral.com/scripts/script-to-kill-the-top-blocker-and-report-what-it-was-doing/feed 0
Rebuild indexes, update stats and shrink https://www.sqlservercentral.com/scripts/rebuild-indexes-update-stats-and-shrink https://www.sqlservercentral.com/scripts/rebuild-indexes-update-stats-and-shrink#respond Wed, 07 May 2003 16:11:28 +0000 https://www.sqlservercentral.com/?ContentItemID=30797 For each user database  rebuild indexes, update statistics and shrink.  The script will use the system catalog to produce a list of databases. If you want to excluce a database add the excluded db name to the 'not in' list.  You can also adjust the target fillfactor.

The post Rebuild indexes, update stats and shrink appeared first on SQLServerCentral.

]]>
For each user database  rebuild indexes, update statistics and shrink.  The script will use the system catalog to produce a list of databases. If you want to excluce a database add the excluded db name to the 'not in' list.  You can also adjust the target fillfactor.

The post Rebuild indexes, update stats and shrink appeared first on SQLServerCentral.

]]>
https://www.sqlservercentral.com/scripts/rebuild-indexes-update-stats-and-shrink/feed 0
Shrink all databases and truncate all logs https://www.sqlservercentral.com/scripts/shrink-all-databases-and-truncate-all-logs https://www.sqlservercentral.com/scripts/shrink-all-databases-and-truncate-all-logs#respond Wed, 07 May 2003 16:09:25 +0000 https://www.sqlservercentral.com/?ContentItemID=30796 For each user database remove all the freespace and truncate the transaction log. The script will use the system catalog to produce a list of databases. If you want to excluce a database add the excluded db name to the 'not in' list below.

The post Shrink all databases and truncate all logs appeared first on SQLServerCentral.

]]>
For each user database remove all the freespace and truncate the transaction log. The script will use the system catalog to produce a list of databases. If you want to excluce a database add the excluded db name to the 'not in' list below.

The post Shrink all databases and truncate all logs appeared first on SQLServerCentral.

]]>
https://www.sqlservercentral.com/scripts/shrink-all-databases-and-truncate-all-logs/feed 0