Forum Discussion

J_Fad's avatar
J_Fad
Frequent Visitor
4 months ago
Solved

Fabric Warehouse - table versions

Hello,
Is there an easy t-sql way to view list of versions of delta table in MS-Fabric Warehouse database?
Like we have in spark with "describe history ..." ?
I know what there's a way to get it at specific time - e.g. via option (for timestamp as of ....)  but it relevant if you know what you're looking for.
Or the only way to get it is via spark? (e.g. as external table or copy folder with metadata and read with spark).
Thank you.

  • Hello J_Fad,

    yup, so far missing this functionality in T-SQL experience. However you can do it using spark sql in the notebook.

    Attach your warehouse to the notebook and query it using 4 part path

    %%sql
    DESCRIBE HISTORY <workspace>.<warehouse>.<schema>.<table>

     

    SELECT * FROM <schema>.<table> OPTION (FOR TIMESTAMP AS OF 'desired timestamp')

    https://learn.microsoft.com/en-us/fabric/data-warehouse/time-travel

     

    Not that trivial, but seem we will get some updates in the future.

4 Replies

  • Lozovskyi's avatar
    Lozovskyi
    Kudo Collector

    Hello J_Fad,

    yup, so far missing this functionality in T-SQL experience. However you can do it using spark sql in the notebook.

    Attach your warehouse to the notebook and query it using 4 part path

    %%sql
    DESCRIBE HISTORY <workspace>.<warehouse>.<schema>.<table>

     

    SELECT * FROM <schema>.<table> OPTION (FOR TIMESTAMP AS OF 'desired timestamp')

    https://learn.microsoft.com/en-us/fabric/data-warehouse/time-travel

     

    Not that trivial, but seem we will get some updates in the future.

  • Hello J_Fad 

     

    DESCRIBE HISTORY is a Spark / Delta Lake construct, implemented in Spark SQL, and as such, it cannot be used in T‑SQL in Microsoft Fabric.
     
    T‑SQL in Fabric does not expose Delta transaction logs or table‑level history metadata in a DESCRIBE HISTORY‑equivalent command. This is a known and documented limitation.
     
    Fabric T‑SQL supports time travel querying using TIMESTAMP AS OF. This is query‑level time travel, not table audit history. 
     
     
  • Thankyou, Lozovskyi and deborshi_nag for your responses.

    Hi J_Fad,

    We appreciate your inquiry through the Microsoft Fabric Community Forum.

    We would like to inquire whether have you got the chance to check the solutions provided by Lozovskyi and deborshi_nag to resolve the issue. We hope the information provided helps to clear the query. Should you have any further queries, kindly feel free to contact the Microsoft Fabric community.

    Thank you.