I created the he following stored procedure to give me a more clear look at the unallocated and unused space used by my databases. The […]
Continue readingTag: T-SQL
Terminate Connections to an SQL Database
Have you ever tried to restore a database to an SQL server with existing connections? Unless the connections are terminated, the database restore will fail […]
Continue readingList all Connections to an SQL Database
A simple, but useful command, this script will show all connections to an SQL server. Replace Database Name with the name of the database and […]
Continue readingSearch for Orphaned Users After a Database Restore
After a database has been restored, users may become orphaned, or disconnected, from the database. You will see an entry for the user in the […]
Continue readingSQL Server CPU Utilization
Some helpful SQL stats from this article. — From the SQL Server Performance Dashboard (sys.dm_os_ring_buffers) — Query CPU utilization for each four minute intervals declare […]
Continue readingList all Documents in SharePoint
I’ve used these queries for years, they come in handy when planning growth or a migration. A quick Google search will find many more queries […]
Continue readingList Databases from an SQL 2005 Server
There are a number of ways to list databases from an SQL 2005 Server. — Easiest way is to use the undocumented SQL 2005 stored […]
Continue readingTransfer SQL Logins to Another SQL 2005 Server
After you move a database from one instance of SQL 2005 to another instance of SQL 2005, the users may not be able to log […]
Continue readingTransfer SQL Logins to Another SQL 2000 Server
The following script will transfer logins and passwords from one SQL 2000 server to another. This script is intended to be used in the rare […]
Continue readingScript to Add a New SQL Differential Backup Job With Daily Incremental Zip Archives
This script builds on the differential backup script, adding a zipped incremental backup. This script will create a zip file for each day of the […]
Continue reading