Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Kevin-Bronsdijk/5ede5adb3edbee8919ec to your computer and use it in GitHub Desktop.
Save Kevin-Bronsdijk/5ede5adb3edbee8919ec to your computer and use it in GitHub Desktop.
executing-sql-statements-using-powershell
Import-Module SQLPS -DisableNameChecking
#replace your with your instance name
$instanceName = "server\instance";
$srv = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Server -ArgumentList $instanceName;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment