Skip to content

Write-DbaDbTableData - Reclassifty warnings as errors #9864

@iainrigg

Description

@iainrigg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featuretriage requiredNew issue that has not been reviewed by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions