Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. [MS SQL SERVER] Create constraints in a cyclic relations

[MS SQL SERVER] Create constraints in a cyclic relations

Scheduled Pinned Locked Moved Database
databasesql-serverdesignsysadminxml
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lutoslaw
    wrote on last edited by
    #1

    I have four tables:

    Class- a "class"
    PK IdClass

    Instance- an instance
    PK IdInstance
    FK IdClass

    PropertyDefinitions- definitions of properties of a concept
    PK IdPropertyDef
    FK IdClass

    PropertyValues- values of properites of an instance
    FK IdInstance
    FK IdPropertyDef

    A Class can have properties. Instance can be of a class. I want to save values of properties of each Instance, but I want to prohibit setting properties of an Instance, which are not defined in it's Class. So, a cyclic dependence occurs. How to create a proper constraint in MS Sql Server to prevent a situation, when an instance has values of properties which are not defined in a class? Or maybe I could design a better DB schema? Thanks. EDIT: Here[^] you can find a applicaable part of a DB diagram.

    Greetings - Jacek

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups