Categories
MSSQL Server

MSSQL Test Connection String With PowerShell

Quickly test a connection string with PowerShell.

$sConString = "Data Source=localhost;Integrated Security=true;Initial Catalog=master; MultipleActiveResultSets=True;" 
$oSQLCon = new-object ("Data.SqlClient.SqlConnection") $sConString 
$oSQLCon.Open() 
$oSQLCon.Close()