 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
[9.5.452 Pro] - "Irregular" temp table names |
|
It seems that SA doesn't handle "slightly irregular" but valid temp table names very well. Check this code below:
 |
 |
SELECT * INTO [#mod_uzemanyag.dims_adatgyujtok] FROM mod_uzemanyag.dims_adatgyujtok;
|
This will create a temporary table named #mod_uzemanyag.dims_adatgyujtok which can only be accessed by adding delimiters to the table name. That works for non-temporary tables, that is, the code:
 |
 |
SELECT * INTO [mod_uzemanyag.dims_adatgyujtok] FROM mod_uzemanyag.dims_adatgyujtok;
|
also creates a table that requires delimiters to query (named mod_uzemanyag.dims_adatgyujtok). When selecting this table from a popup, the delimiters are added:
 |
 |
SELECT * FROM dbo.[mod_uzemanyag.dims_adatgyujtok] AS da
|
However, selecting the temporary table yields:
 |
 |
SELECT * FROM #mod_uzemanyag.dims_adatgyujtok AS da
|
which will not work.
|
|
Thu Feb 22, 2018 6:28 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
I believe it looks for # and ## in the beginning of table names to identify temp tables; and it doesn't recognize "[#" as a bracketed temp table name. As a result, it tries to locate that table definition and columns in the current database.
|
|
Fri Feb 23, 2018 10:30 am |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
Incorrect identification might happen during/after insertion into the editor. When expanding and selecting columns in the popup the table is correctly identified as a temporary one because it is expanded and the column list is properly populated.
|
|
Fri Feb 23, 2018 5:02 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|