Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Elmo22
Frequent Visitor

changing datasource and changing sttings for each query

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

1 ACCEPTED SOLUTION
nicholas185
New Member


@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

View solution in original post

1 REPLY 1
nicholas185
New Member


@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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors