Identifying the columns in temp table in synapse

Nandan Hegde 32,336 Reputation points MVP
2020-09-02T07:21:13.557+00:00

Hello All,
How can we get the list of all columns present in a temp table in Synapse?

IF OBJECT_ID(N'tempdb..#LocalCustomer') IS NOT NULL
BEGIN
Drop table  #LocalCustomer
Go

CREATE TABLE ajs.#LocalCustomer
(
 CustomerId int,
 CustomerName varchar(50))

I tried the below syntax to get the column details :

select * from tempdb.sys.columns where object_id =
object_id('tempdb..#localcustomer');

But I am getting the below error:
Msg 208, Level 16, State 1, Line 11
Invalid object name 'tempdb.pdw.columns'.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,916 questions
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.