on 2012 Aug 10 11:18 AM
How can I get temp table meta data as I need to know column names and types. select * from tempdb.sys.syscolumns where tname like '#task' is not working, however #task table is there
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).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.