I have a SQL Server 2016 database with temporary tables. One temporary table is called Company. I am trying to query it for current records and all historical records. First I tried the following query:
select * from Company c FOR SYSTEM_TIME all
and got the following error: Invalid syntax next to "FOR".
However, if I try it without an alias, it works fine:
select * from Company FOR SYSTEM_TIME all
I could not find documentation about this - is it a legal restriction, a known problem, or something else?
source share