Home » Bigquery » Tutorials » Drop temp table

BigQuery Drop temporary table

BigQuery temp tables are active only within the session that created them. There is no storage cost for temporary tables, and are cleaned up automatically within 24 hours. so its not required to explicitly drop the temp tables. However, within the session its possible to drop the temp table using the DROP TABLE command

Drop temp table example

    CREATE TEMP TABLE Example
    (
      x INT64,
      y STRING
    );
    
    INSERT INTO Example
    VALUES (5, 'foo');
    
    INSERT INTO Example
    VALUES (6, 'bar');
    
    SELECT * FROM Example;
    
    drop table _SESSION.Example;