SQL-Statement with dynamic table-names or redesign?

前端 未结 3 2070
慢半拍i
慢半拍i 2021-01-26 01:44

I have a MS SQL 2008 database which stores data for creating a weighted, undirected graph. The data is stored in tables with the following structure:

[id1] [int]         


        
3条回答
  •  情歌与酒
    2021-01-26 02:04

    Partioned Table may be the answer to your problem. I've got another idea, that's "the other way around":

    • each graph has it's own table (so you can still truncate table)
    • define a view (with the structured you mentioned for your redefined table) as a UNION ALL over all graph-tables

    I have no idea of the performance of a select on this view and so on, but it may give you what you are looking for. I'd be interested in the results if try this out ..

提交回复
热议问题