Import-DbaCsv: Add -NoColumnOptimize switch#10195
Merged
potatoqualitee merged 1 commit intodataplat:developmentfrom Mar 5, 2026
Merged
Import-DbaCsv: Add -NoColumnOptimize switch#10195potatoqualitee merged 1 commit intodataplat:developmentfrom
potatoqualitee merged 1 commit intodataplat:developmentfrom
Conversation
…n shrinking When using -AutoCreateTable to import multiple CSV files into the same table, the post-import Optimize-ColumnSize step shrinks nvarchar(MAX) columns to fit the first file's data, causing subsequent imports to fail if later CSVs contain longer values. The new -NoColumnOptimize switch skips this step, keeping columns at nvarchar(MAX). Tracks dataplat#10194 (do Import-DbaCsv) Co-Authored-By: Claude Opus 4.6 <[email protected]>
Member
|
awsome, thank you 🙏🏼 will release your changes in a few days unless you need it faster. |
Contributor
Author
|
No that's fantastic thanks. I'm just running an old version from before the auto-optimize was added for the affected process for now, few more days makes no difference |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Invoke-ManualPester)Purpose
Allows optional skipping of the schema detection and column resize from NVARCHAR(MAX) after Import-DbaCsv has imported a file using -AutoCreateTable. Useful when importing multiple CSVs to the same table, as without a later CSV with a wider column than the first file would fail due to data truncation
Approach
-NoColumnOptimizeswitch toImport-DbaCsvthat skips the automaticOptimize-ColumnSizestep after-AutoCreateTableimportsnvarchar(MAX)when the switch is set, allowing multiple CSV files to be imported into the same auto-created table without column truncation failures🤖 Generated with Claude Code