Skip to content

Commit

Permalink
Write-DbaDbTableData - Fail AutoCreateTable if no column definition a…
Browse files Browse the repository at this point in the history
…vailable (dataplat#9362)
  • Loading branch information
andreasjordan authored May 22, 2024
1 parent 3470250 commit aa3ecb2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions public/Write-DbaDbTableData.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,11 @@ function Write-DbaDbTableData {
$columns = $DataTable.Table.Columns
}

if ($null -eq $columns) {
Stop-Function -Message "Unable to get column definition from input data, so AutoCreateTable is not possible"
return
}

foreach ($column in $columns) {
$sqlColumnName = $column.ColumnName

Expand Down

0 comments on commit aa3ecb2

Please sign in to comment.