Time Travel in Fabric Warehouse – Query Historical Data with T-SQL
Microsoft Fabric's Time Travel feature allows you to query past versions of your data warehouse tables using T-SQL. It’s a powerful capability for historical analysis, reproducibility, and data recovery.
๐ What is Time Travel?
- Query data as it existed at a specific point in time
- Retention up to 30 days
- Uses the
FOR TIMESTAMP AS OF
clause in SELECT statements - Read-only – no updates, deletes, or inserts allowed
✅ Syntax Example
SELECT *
FROM dbo.dimension_customer
OPTION (FOR TIMESTAMP AS OF '2024-03-13T19:39:35.280');
๐ Use this to get current UTC timestamp in correct format:
SELECT CONVERT(varchar, SYSUTCDATETIME(), 126) AS TruncatedUTC;
๐ Use Cases for Time Travel
- ๐ Historical trend analysis and reporting
- ๐งช Machine learning model reproducibility
- ๐ Root cause investigations and debugging
- ๐ Safe verification during ETL pipeline development
- ✅ Compliance and audit traceability
๐ Permissions
- Roles: Admin, Member, Contributor, Viewer
- Security enforced: RLS, CLS, and DDM apply even in time travel
⚠️ Limitations
- Only SELECT statements are supported
- Not supported inside views or CTAS queries
- Only UTC timestamps are allowed (no local timezones)
- Supports up to 3-digit millisecond precision
- Not usable on Lakehouse endpoints or Power BI datasets directly