The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi All
Should I change the sittings for each query when changing the data source?
or there is a way changing the data source sittings from datasource sittings only
Solved! Go to Solution.
@Elmo22 wrote:Hi All
Should I change the sittings for each query when changing the data source? dollartree-compass.com
or there is a way changing the data source sittings from datasource sittings only
Hello, @Elmo22
To change the data source for your queries efficiently:
Update Data Source Settings:
If the schema is the same, update the connection details in your data source settings. This will apply to all queries automatically.
Adjust Queries Individually:
If the schema is different, you need to update each query to match the new data source structure.
Steps:
SQL Clients/BI Tools:
Open your tool (e.g., SQL client, Tableau, Power BI).
Navigate to Data Source/Connection settings.
Update the connection details (server, database, credentials).
Save and refresh.
Code Example (Python with SQLAlchemy):
# Update connection string
new_connection_string = 'mysql+pymysql://user:password@new_host/new_db'
engine = create_engine(new_connection_string)
connection = engine.connect()
result = connection.execute("SELECT * FROM my_table")
Consistent Schema: Change connection settings only.
Different Schema: Update each query as needed.
Test your queries after making changes to ensure they work with the new data source.
I hope this step is helpful for you.
Best Regard,
nicholas185
@Elmo22 wrote:Hi All
Should I change the sittings for each query when changing the data source? dollartree-compass.com
or there is a way changing the data source sittings from datasource sittings only
Hello, @Elmo22
To change the data source for your queries efficiently:
Update Data Source Settings:
If the schema is the same, update the connection details in your data source settings. This will apply to all queries automatically.
Adjust Queries Individually:
If the schema is different, you need to update each query to match the new data source structure.
Steps:
SQL Clients/BI Tools:
Open your tool (e.g., SQL client, Tableau, Power BI).
Navigate to Data Source/Connection settings.
Update the connection details (server, database, credentials).
Save and refresh.
Code Example (Python with SQLAlchemy):
# Update connection string
new_connection_string = 'mysql+pymysql://user:password@new_host/new_db'
engine = create_engine(new_connection_string)
connection = engine.connect()
result = connection.execute("SELECT * FROM my_table")
Consistent Schema: Change connection settings only.
Different Schema: Update each query as needed.
Test your queries after making changes to ensure they work with the new data source.
I hope this step is helpful for you.
Best Regard,
nicholas185