# How do I prevent GX from creating temporary tables in my DB?

**URL:** <https://discourse.greatexpectations.io/t/how-do-i-prevent-gx-from-creating-temporary-tables-in-my-db/1267>\
**Category:** GX Core Support\
**Created:** [July 14, 2023, 8:34pm UTC](https://discourse.greatexpectations.io/t/how-do-i-prevent-gx-from-creating-temporary-tables-in-my-db/1267 "2023-07-14T20:34:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![austin\_gx](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.greatexpectations.io/austin_gx/32/193_2.png) [@austin\_gx](https://discourse.greatexpectations.io/u/austin_gx)\
**Post date:** [July 14, 2023, 8:34pm UTC](https://discourse.greatexpectations.io/t/how-do-i-prevent-gx-from-creating-temporary-tables-in-my-db/1267/1 "2023-07-14T20:34:26Z")

</div>

> [@](#):
>
> [**View in #gx-community-support on Slack**](https://slack.com/archives/CUTCNHN82/p1682240816514069)
> 
> ![Albert_H_Sun](https://canada1.discourse-cdn.com/flex031/uploads/greatexpectations/original/1X/3a5128d7b4b8756779e9d0a068319d3bf1495486.jpeg) **@Albert\_H\_Sun:** Hello everyone, do you have any idea on how to use GX to test data in a rdbms that doesn’t support CREATE TEMPORARY TABLE AS SELECT ? In my case I’m using tidb, which only supports grammar like :  
> CREATE TEMPORARY TABLE users (  
> id BIGINT,  
> name VARCHAR(100),  
> city VARCHAR(50),  
> PRIMARY KEY(id)  
> );

---

<div class="post-metadata">

**Author:** ![austin\_gx](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.greatexpectations.io/austin_gx/32/193_2.png) [@austin\_gx](https://discourse.greatexpectations.io/u/austin_gx)\
**Post date:** [July 14, 2023, 8:35pm UTC](https://discourse.greatexpectations.io/t/how-do-i-prevent-gx-from-creating-temporary-tables-in-my-db/1267/2 "2023-07-14T20:35:34Z")

</div>

> [@](#):
>
> ![Austin_Robinson_(GX)](https://canada1.discourse-cdn.com/flex031/uploads/greatexpectations/original/1X/b5111acb265c34d487b2cef85cabdc8762c47e2d.jpeg) **@Austin\_Robinson\_(GX):** Hey @Albert\_H\_Sun! Thanks for reaching out.
> 
> You can pass `create_temp_table` as `False` to your Datasource.
> 
> Depending on how your datasource is configured, that may look like:
> 
> ```auto
> datasource = great_expectations.datasource.fluent.SQLDatasource(..., create_temp_table=False)
> 
> ```
> 
> or something like:
> 
> ```auto
> datasource_config: dict = {
> "name": "my_datasource_name",
> "class_name": "Datasource",
> "module_name": "great_expectations.datasource",
> "execution_engine": {
> "class_name": "SqlAlchemyExecutionEngine",
> "module_name": "great_expectations.execution_engine",
> "connection_string": CONNECTION_STRING,
> "create_temp_table": False
> },
> }
> 
> ```
> 
> ![Albert_H_Sun](https://canada1.discourse-cdn.com/flex031/uploads/greatexpectations/original/1X/3a5128d7b4b8756779e9d0a068319d3bf1495486.jpeg) **@Albert\_H\_Sun:** @Austin\_Robinson\_(GX) thank you so much! Finally it works ~~~~

---

<div class="post-metadata">

**Author:** ![Mfaisal](https://avatars.discourse-cdn.com/v4/letter/m/c6cbf5/32.png) [@Mfaisal](https://discourse.greatexpectations.io/u/Mfaisal)\
**Post date:** [June 10, 2024, 7:53am UTC](https://discourse.greatexpectations.io/t/how-do-i-prevent-gx-from-creating-temporary-tables-in-my-db/1267/3 "2024-06-10T07:53:41Z")

</div>

hi @austin_gx , Does this solution work for MS-SQL Server Data source ?

---

<div class="post-metadata">

**Author:** ![austin\_gx](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.greatexpectations.io/austin_gx/32/193_2.png) [@austin\_gx](https://discourse.greatexpectations.io/u/austin_gx)\
**Post date:** [June 10, 2024, 6:06pm UTC](https://discourse.greatexpectations.io/t/how-do-i-prevent-gx-from-creating-temporary-tables-in-my-db/1267/4 "2024-06-10T18:06:15Z")

</div>

Hey @Mfaisal – tagging in @rachel.house or @nevintan to answer this definitively – but to my knowledge this should hold true for any datasources supported by GX.
