Column's list temp table?
How I get column's list temp table (#tablename) ?
January 9th, 2014 1:34pm

Hello,

If you use on premise SQL Server, you can refer to the following query to get the column list for a temp table:

SELECT * FROM tempdb.sys.columns
WHERE object_id = (SELECT object_id FROM tempdb.sys.objects WHERE NAME like '#tablename%' AND Type = 'U')

However, in SQL database, it is support only local temporary tables, not global temp, so only the temp table is only available in the session, which created the temp table.
What's more, Cross Databases Queries are not supported in SQL Azure. So if you run the query above, you may get following error message:
reference to database and/or server name in 'tempdb.sys.columns' is not supported in this version of SQL Server.

Regards,
Fanny Liu

Free Windows Admin Tool Kit Click here and download it now
January 10th, 2014 5:22am

Yes, I know it. I'm looking for a solution for the SQL Azure.
January 10th, 2014 10:13am

Nobody tell me?
Free Windows Admin Tool Kit Click here and download it now
January 11th, 2014 2:46pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics