-
-
Notifications
You must be signed in to change notification settings - Fork 852
Description
Summarize Functionality
Allow errors in the data that are provided to Write-DbaDbTableData to be caught by try/catch blocks.
Is there a command that is similiar or close to what you are looking for?
No
Technical Details
When there is a problem with the data that is being passed to Write-DbaDbTableData, a warning is displayed which means by default it will not be caught by a try/catch block without specifying -WarningAction Stop on every call to this function.
For business critical applications failing to write data to a table is more than a warning a should be considered an error to allow for proper error handling.
Examples.
WARNING: [05:29:25][Write-DbaDbTableData] Table does not exist and automatic creation of the table has not been selected. Specify the '-AutoCreateTable'-parameter to generate a suitable table.
WARNING: [05:34:21][Write-DbaDbTableData] Failed to bulk import to [Database].[dbo].[test] | Value was either too large or too small for an Int64.