Monday, 1 October 2012

How to check instances of the MS SQL Server on the local machine

If you have installed the SQL Server 2008 client utilities, you can get a list of the DB Engine instances on the local computer using the SQL Server PowerShell provider.

Launch the Windows Run... command and specify sqlps. That will open a window that looks like a command prompt window, but is a PowerShell window that has loaded the SQL Server PowerShell provider. You should be sitting on a prompt:

PS SQLSERVER:\>

Run these commands:

cd SQL\localhost
dir

That will display the instances on the local computer. If you have a default instance, it will be displayed with the name DEFAULT.

For example, when I do that on my computer with a default and named instance, the dir returns:

Instance Name
-----------------
DEFAULT
TESTINST

No comments:

Post a Comment