vertical-partitioning

Foreign key refering to multiple tables

允我心安 提交于 2020-01-24 17:03:46
问题 I have 4 tables A(ida, name) B(ida, B-specific stuff) C(ida, C-specific stuff) D(ida, D-specific stuff) and i want that another table E could refer to just B OR C (not D). What can i write in the CREATE TABLE E ? 回答1: Seems to me that you are trying to use some kind of supertype/subtype -- as opposed to simple vertical partitioning. If so, do introduce a type-discriminator. Because this is generic example (A, B, C, D ..) it is hard to guess what relates to what, so here are two options as my

SQL Server: Any value in vertical partitioning when i'm always going to re-JOIN them?

感情迁移 提交于 2019-12-12 20:08:20
问题 i'm faced with having to add 64 new columns to table that already had 32 columns. For examples sake: Customers ( CustomerID int Name varchar(50) Address varchar(50) City varchar(50) Region varchar(50) PostalCode varchar(50) Country varchar(2) Telephone varchar(20) ... NewColumn1 int null NewColumn2 uniqueidentifier null NewColumn3 varchar(50) NewColumn4 varchar(50) ... NewColumn64 datetime null ... CreatedDate datetime LastModifiedDate datetime LastModifiedWorkstation varchar(50)