Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Managing Schema Changes: SQL Database Projects and DACPAC (State-Based) vs DbUp and Flyway (Migration-Based)
A state-based tool doesn't know about renames: after a column was renamed in the project, SqlPackage tried to drop and re-add it and was stopped only by BlockOnPossibleDataLoss; with a refactorlog it generated sp_rename. DACPACs with Microsoft.Build.Sql 2.3.0, deploy scripts and DeployReport, a hand-added index dropped by default, a CHECK definition that causes a false diff, and a changed migration DbUp misses and Flyway catches by checksum.
Moving Data in SQL Server: BULK INSERT, bcp, OPENROWSET, BACPAC Export/Import and Copying Databases
MAXERRORS in BULK INSERT doesn't skip every error: a single CSV row with the wrong column count stopped a 200,000-row load at zero. The file path resolved on the server, CODEPAGE not supported on Linux, the CR stuck to the last column of a CRLF file, staging and validation, log down from 43 MB to 0.5 MB with BULK_LOGGED and TABLOCK, OPENROWSET and bcp, and BACPAC export/import with SqlPackage from an anonymized copy.