Check if a temporary table exists and delete if it exists before creating a temporary table

前端 未结 15 727
忘掉有多难
忘掉有多难 2020-11-29 14:13

I am using the following code to check if the temporary table exists and drop the table if it exists before creating again. It works fine as long as I don\'t change the colu

15条回答
  •  攒了一身酷
    2020-11-29 15:05

    I usually hit this error when I have already created the temp table; the code that checks the SQL statement for errors sees the "old" temp table in place and returns a miscount on the number of columns in later statements, as if the temp table was never dropped.

    After changing the number of columns in a temp table after already creating a version with less columns, drop the table and THEN run your query.

提交回复
热议问题