Optional relationship in SQL Server -- How to implement in SSMS Schema Designer -
i have 2 cases set 'optional' relationship inside 1 table or between 2 tables.
first:
i want set relation optional, in other words: there categories , subcategories in 1 table, subcategory column optional.
second:
here want make sure house cannot exist without member (mandatory relation), member can without house (optional relation).
i don't have experience microsoft sql server , don't have idea how can modify these relations.
here end result in oracle diagram:
if you're asking how can done in schema designer (db diagram) in sql management studio, it's easy:-
- right-click table in digram, choose 'table view' -> 'standard'
- in 'allow nulls' column, set optional foreign keys 'allow nulls'
- press ctl + s save updates schema.
additional details selected object in designer (column, table, fk etc.) available viewing properties window (usually in right of screen). example, here properties subcat
column in example:
Comments
Post a Comment