Identifying the columns in temp table in synapse
Nandan Hegde
32,336
Reputation points MVP
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'.
Sign in to answer