Forum Discussion
Update db schema en masse, SQL Server Connector
- 4 years ago
Hi Anonymous ,
A couple of ideas:
1) To retrofit:
- Select all queries in Power Query that you want to change schema, copy, paste into your text editor of choice.
- In text editor, Find & Replace 'Schema="dbo"' with 'Schema="newSchema"'.
- Delete all selected queries from PQ.
- Select all in text editor and paste into PQ query pane.
2) To manage in future:
- In each new PBIX, create a query called 'schema' that is just '="dbo"'.
- For each new table you import that is likely to change schema, change 'Schema="dbo"' to 'Schema=schema'.
- You can now change the schema in all queries if required by changing the value in your new schema query.
Pete
Hi Anonymous ,
A couple of ideas:
1) To retrofit:
- Select all queries in Power Query that you want to change schema, copy, paste into your text editor of choice.
- In text editor, Find & Replace 'Schema="dbo"' with 'Schema="newSchema"'.
- Delete all selected queries from PQ.
- Select all in text editor and paste into PQ query pane.
2) To manage in future:
- In each new PBIX, create a query called 'schema' that is just '="dbo"'.
- For each new table you import that is likely to change schema, change 'Schema="dbo"' to 'Schema=schema'.
- You can now change the schema in all queries if required by changing the value in your new schema query.
Pete
Thank you BA_Pete !! I did not know that just copying from the query pane into a text editor would transfer the m code, and vice versa.
That might be a workable solution to make the best of this messy situation.