Use temp table with SQLAlchemy

前端 未结 2 748
醉话见心
醉话见心 2021-02-06 01:31

I am trying to use use a temp table with SQLAlchemy and join it against an existing table. This is what I have so far

engine = db.get_engine(db.app, \'MY_DATABAS         


        
2条回答
  •  长发绾君心
    2021-02-06 02:14

    You can try to use another solution - Process-Keyed Table

    A process-keyed table is simply a permanent table that serves as a temp table. To permit processes to use the table simultaneously, the table has an extra column to identify the process. The simplest way to do this is the global variable @@spid (@@spid is the process id in SQL Server).

    ...

    One alternative for the process-key is to use a GUID (data type uniqueidentifier).

    http://www.sommarskog.se/share_data.html#prockeyed

提交回复
热议问题