For local temporary tables you may use "select * from sa_describe_query('select * from temp1')". For global temporary table you can pick up the schema from the catalog (e.g syscolumns view). answered 13 Aug '12, 07:14 Hartmut Branz |
Are you using SQL Anywhere at all? AFAIK, the particular "tempdb" database is a particular ASE/MS SQL Server facility to store temporary tables. SQL Anywhere (SA) has no explicit "tempdb" database, nor does it use the three-part-name schema (database.owner.table). So it seems the select from tempdb.sys.syscolumns completely ignores the "database" specifier and is really just a select from sys.syscolumns and simply returns alls rows for all permanent tables and for all global temporary tables. So, if you're using SA, then "#task" will only be in the result set if it is a global temporary table. FWIW, SA's "temp" dbspace is something completely different... answered 10 Aug '12, 11:18 Volker Barth Creating global temp table works for me as I can get data from sys.syscolumns. Thanks a lot.
(14 Aug '12, 07:11)
memphis
|
What type of temporary table is this, how is it created?
- CREATE GLOBAL TEMPORARY TABLE
- CREATE LOCAL TEMPORARY TABLE
- DECLARE LOCAL TEMPORARY TABLE
- SELECT ... INTO #task FROM ...
Which version of SQL Anywhere are you using?
Table was created using create LOCAL