MS Access database (2010) how to create temporary table/procedure/view from Query Designer

Kajiyama picture Kajiyama · Apr 17, 2015 · Viewed 39k times · Source

Is there any way how to create temporary table/view/stored procedure in MS Access database (2010) using Query Designer?

Whenever i try to execute something like this:

SELECT * INTO #temp_table
FROM (SELECT column_1, column_2 FROM table)

MS Access throws an error:

Syntax error in CREATE TABLE statement.

With no further information.

Answer

Gord Thompson picture Gord Thompson · Apr 17, 2015

Access SQL does not support executing more than one SQL statement at a time, so the notion of a #temp table does not really apply. If you require a temporary table then you need to

  • create a "real" table,
  • do your work with it, and then
  • delete (drop) the table when you're done.