Forum Discussion
DataMart Change Table Structure
Hi Anonymous ,
In this official document can see, when use the Transact-SQL ALTER TABLE...SWITCH statement to quickly and efficiently transfer subsets of your data, there is a requirement for the source table and the target table:
Source and target tables must have the same column structure and order. The tables must have the same columns with the same names and the same data type, length, collation, precision, scale, nullability, and PRIMARY KEY constraints (if any), and also have the same settings for ANSI_NULLS and QUOTED IDENTIFIER. Additionally, the columns must be defined in the same order. The IDENTITY property is not considered.
So, based on this, your two tables don't have the same number of columns, caused the error.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi v-yanjiang-msft - appreciate you responding, but I don't think you are understanding the question. Power BI creates the tables behind the scenes - we don't. (Imported) Tables will definitely change structure over time, and the datamart needs to account for this. Please pass this along to the product team. This same situation will happen in a regular database, but we don't have full control over the back-end db associated with the datamarts in Power BI, do we?
Thank you,
-hauffa
- Anonymous4 years agoNot applicable
Hauffa's comment is correct! We don't have permissions to alter table ourselves and the documentation is not clear.