A flexible foreign key

前端 未结 3 1614
半阙折子戏
半阙折子戏 2020-12-11 10:49

I have a sql server database. I\'m developing a vb.net application.

Now I\'m thinking to have an \"Event\" table that should keep all the events related with my data

3条回答
  •  情书的邮戳
    2020-12-11 11:17

    You could create an 'INDEXED VIEW' -- define it however you like to pull the objectIDs + any other relevant fields, as you've described, from record 25 of the clients table, record record 30 of the invoices table, and so on.

    You could do the same thing with a stored procedure.

    Depending on how you intend to consume the data -- if you're just pulling it into a vb.net datatable, either of these options should work fine.

    A benefit to an approach like this is that you don't have to create or maintain any new tables in your database.

提交回复
热议问题