title: Temp tables in delphi query
body: <p>I am trying to union this into the temp table. Do you see some wrong syntax in here? 
  When I'm executing it is not showing any problem, but when I try to refer to this query it says 'invalid table name #Temp_trans_13' ( I am using MSSQL).</p>
  
  <pre><code>select * into #temp_trans_13 from (
  select 
        periode,
        konto_nr as ktonr,
        konto_kurztext as ktobez,
        soll_periode - haben_periode as SaldoMonat,
        soll_saldo - haben_saldo as SaldoJahr
  
  from
        sap_SuSa_liste
  where
        Jahr = :jahr
  and   periode = 12
  and   buchungskreis = :bkr
  and   konto_nr between '200000' and '999999'
  union
  select
        periode,
        konto_nr as ktonr,
        konto_kurztext as ktobez,
        soll_periode - haben_periode as SaldoMonat,
        soll_saldo - haben_saldo as SaldoJahr
  
  from
        sap_SuSa_liste
  where
        Jahr = :jahr
  and   periode = 13
  and   buchungskreis = :bkr
  and   konto_nr between '200000' and '999999'
  union
  select
        periode,
        konto_nr as ktonr,
        konto_kurztext as ktobez,
        soll_periode - haben_periode as SaldoMonat,
        soll_saldo - haben_saldo as SaldoJahr
  
  from
        sap_SuSa_liste
  
  where
        Jahr = :jahr 
  and   periode = 14
  and   buchungskreis = :bkr
  and   konto_nr between '200000' and '999999')t 
  </code></pre>