bruin-data / ingestr

ingestr is a CLI tool to copy data between any databases with a single command seamlessly.
https://bruin-data.github.io/ingestr/
MIT License
2.53k stars 58 forks source link

Error while adding columns with alter table in SQL Server #13

Closed MarkusBellmann closed 5 months ago

MarkusBellmann commented 7 months ago

I tried to load tables from one MS SQL database into the other. I got the error message that an "alter table" cannot add columns without default value or null column. This is my Test:

.\ingestr ingest --source-uri 'mssql://:@localhost:1433/WideWorldImporters?driver=ODBC+Driver+18+for+SQL+Server&TrustServerCertificate=yes' --source-table 'Sales.Orders' --dest-uri 'mssql://:@localhost:1433/Staging?driver=ODBC+Driver+18+for+SQL+Server&TrustServerCertificate=yes' --dest-table 'raw_wwi.Orders'

karakanb commented 7 months ago

I'll take a look at this and will let you know what's happening there. in the meantime if you could share any example data or steps to reproduce that'd help a lot.

karakanb commented 7 months ago

hi @MarkusBellmann did you try to load into a table that already exists by any chance? I'll make sure to update the docs with this note as well, but ingestr cannot load into pre-existing tables, it needs its own destination table.

karakanb commented 5 months ago

Hi Markus, it seems like this issue only occurs when the destination is an existing table, which is a case we do not fully support at the moment, therefore I'll be closing this issue. Please give this a try with a brand new destination table and let me know if you still encounter an issue there.