PowerShell to SQL

One of the most PowerShell features in dbatools is the ability to write PowerShell objects straight to tables in SQL:

Get-ChildItem | Write-DbaDataTable -SqlInstance sql2017 -Table mydb.dbo.logs -Truncate

This will convert data straight from a PowerShell object to DataTable and push it to a table on the SQL instance (creating it if needed). Note that there may be some data loss in the case of complex objects, but common property types, such as strings, numbers, date, time, and so on, are preserved.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset