Does anybody face an issue when you drop a temporary table at the Sybase ASE 12 it still persists at a current session. So you encounter "Table already exists" when trying to select data into it again
Well, you need to read the manuals, at least the syntax for the commands you expect to use, before you write code. Otherwise you will face issues at every turn. It depends on what you are trying to do.
SELECT ... INTO #MyTable
creates a table and succeeds because it does not exist. So a second SELECT ... INTO #MyTable
will try to create #MyTable
, find that it exists, and fail.
If you want to perform a second SELECT
into the same table, TRUNCATE
the table, then use SELECT ... INTO EXISTING TABLE #MyTable
.
Or DROP TABLE
and skip the EXISTING TABLE
modifier.
If you want the table to contain the sum of several SELECTS
, obviously, skip the TRUNCATE
.