Get some clustered facts about your server.
The Deep Secrets of My Computing Environment!
In my computing environment, I have a set of tools that I rely on because they just make life easier. Here they are in order of (perceived) actual usage.
Getting all services running SQL Server using T-SQL: SELECT * FROM sys.dm_server_services
Getting all SQL Server services running on a server using PowerShell: Get-WmiObject -Class sqlservice -Namespace “ROOT\Microsoft\SqlServer\ComputerManagement11” | Select ServiceName Additionally, this can be set to an array and worked with as such. $services = Get-WmiObject -Class sqlservice -Namespace “ROOT\Microsoft\SqlServer\ComputerManagement11” | Select ServiceName foreach($service in $services) { $service.ServiceName } $services[0].ServiceName >>...
The basics of creating a PowerShell array and working with it.
PowerShell script that prints out the state of the node you are on – Active or Passive.
One common question I hear whenever something begins to go wrong is, “Has anything been changed recently?” Finding recent changes can be a good place to search, depending on the issue, so here is a script to do just that. /* – Relatively light weight – runs in a couple...
Although moving database files around is simple, it is a still big deal. When you do this, you are moving the entire database contents to another location. If you have the space, a backup beforehand wouldn’t be a bad idea. This is the script that I use to make this...
If you need to compare two users in SQL Server, here is a handy script. The output is simply a script to make the “UserToChange” sync up with the “ModelUser”. So this script generates a script.
The T-SQL method to find the active node that a SQL service is running on: SELECT SERVERPROPERTY(‘ComputerNamePhysicalNetBIOS’) as ActiveNode