Get structure of temp table (like generate sql script) and clear temp table for current instance

前端 未结 7 1981
粉色の甜心
粉色の甜心 2021-01-30 19:56

How do I get structure of temp table then delete temp table. Is there a sp_helptext for temp tables? Finally is it possible to then delete temp table in same session or query

7条回答
  •  伪装坚强ぢ
    2021-01-30 20:26

    As long as I know there is no SP_HelpText for tables. Try this:

    Select * From tempdb.sys.columns Where object_id=OBJECT_ID('tempdb.dbo.#myTempTable');
    

提交回复
热议问题