Cool new PowerShell commands for SQL Server: Read-SqlTableData and Write-SqlTableData

Posted: (EET/GMT+2)

 

The latest SQL Server Management Studio (SSMS) update with version number 13.0.15900.1 (also known as release 16.4.1) contains, among other things, three new nice PowerShell commands that are aimed at working with directly SQL Server table and view data.

These new commands can be found from the "SqlServer" module stored at "C:\Program Files\WindowsPowerShell\Modules", and can be imported into PowerShell using the "import-module SqlServer" command.

Once you have loaded the correct module into PowerShell, you can issue commands like this:

Read-SqlTableData -ServerInstance "localhost" -DatabaseName "Northwind"
-Table "Customers" -SchemaName "dbo"

Very nice indeed. In case you need to automate table and view reading and writing, be sure to check out these new commands. To get access to them, update SQL Server Management Studio to the latest version.

Happy hacking!