home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 17,787 of 19,505   
   Erland Sommarskog to wackyphill@yahoo.com   
   Re: Many to many table design question   
   18 Mar 10 23:48:28   
   
   5c83ec78   
   From: esquel@sommarskog.se   
      
   wackyphill@yahoo.com (wackyphill@gmail.com) writes:   
   > I like the idea Erland. I wish I could use 2008 for this but must use   
   > 2005 for now. There are a few types where yes, there is a primary   
   > (MainResponsible). What I have been doing is modeling that as a   
   > Foreign Key field of the Property table. So for example there is   
   > technically only 1 real Property manager so there is a   
   > PrimaryManagerID field in the property table.   
   >   
   > However there are situations where other people need to act as   
   > property manager for that property in order to provide coverage, etc.   
   > So that's how this Many2Many table came into being. Do you think this   
   > is a bad thing to do?   
      
   No, it sounds right.   
      
   > The problem with the way I'm doing it is I need to decide if the   
   > Many2Many table should include the primary person as well as the non-   
   > primary people or just the non-primary people.   
   >   
   > What do you think?   
      
   I think you should have everyone there. Then you can set up an indexed   
   view over the primary onces. The point here is that the indexed view   
   can serve to enforce that there can only be one main for each role.   
      
   --   
   Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se   
      
   Links for SQL Server Books Online:   
   SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx   
   SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx   
   SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca