MS SQL – list instances

1. powershell

Get-ItemProperty 'HKLM:\Software\Microsoft\Microsoft SQL Server\Instance Name\SQL'

2. SQL

select [DatabaseName] = name,
[Status] = state_desc,
[RecoveryModel] = recovery_model_desc,
[CompatLvl] = compatibility_level,
[Collation] = collation_name,
[Owner] = suser_sname( owner_sid )
from sys.databases
order by name

Leave a Reply

Your email address will not be published. Required fields are marked *