Hi i have 17 report to be download from powerbi and inserted to scham dataware house tables
Already i have inserted 7 reports and filled in rest of 10 reports. I got error like that the data type is mismatch. In reality columns names , data type / table name all matches.
How i can solve this all 10 reports failed in bulk insert and soluation? Especially i have big set of data for each report reach 10000 row per report
Hi..
this is almost always the DataTable side, not the database, Power BI usually brings numbers and dates out as text, so a column that is a date or a decimal in your database is arriving as a String in the DataTable
Bulk Insert runs on SqlBulkCopy and it does not convert types so a String going into an int, decimal or datetime column throws data type mismatch even when the names match… The 7 that worked were probably already clean or all text
That is also why I would be careful with the convert everything to string, it only helps if your database columns are varchar too, but they usually are not, so stringifying a column that maps to int or datetime gives you the same error back
What works better is to cast each column to the type the destination actually expects, and turn empty values into DBNull for the numeric and date columns, because an empty “” will never go into a number or date field, and Power BI loves to hand you empty strings
Also quickly check that the column order and count match the table exactly on those 10, one shifted or extra column drops the data into the wrong typed column and looks like a type mismatch… the 10000 rows are not the problem, it is one bad column somewhere, If you log the DataTable column types right before the inserte you will see which one does not line up