Foreign key and relationship in SSDSIs there a foreign key / relationship concept in SSDS? <br><br>For Foreign Key part, I can simply store the parent Entity Id in the records. But it makes me wonder how to manage cascade update / cascade delete? Are the features supported in SSDS, or I have to manage them myself?<br><br>One way to avoid cascade update is to assign a unique Id to entity which cannot be changed once inserted, e.g. Identity column in SQL Server 2005, or use GUID. This leads to another question, does SSDS support Identity / auto-numbering / GUID-generation as in SQL Server 2005? Or I have to assign my own GUID from client side?<br> © 2009 Microsoft Corporation. All rights reserved.Sat, 28 Jun 2008 00:09:44 Zb1b147d2-dfc8-4cfd-a236-7f1172b2b2c3http://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/b1b147d2-dfc8-4cfd-a236-7f1172b2b2c3#b1b147d2-dfc8-4cfd-a236-7f1172b2b2c3http://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/b1b147d2-dfc8-4cfd-a236-7f1172b2b2c3#b1b147d2-dfc8-4cfd-a236-7f1172b2b2c3c.c.chaihttp://social.msdn.microsoft.com/Profile/en-US/?user=c.c.chaiForeign key and relationship in SSDSIs there a foreign key / relationship concept in SSDS? <br><br>For Foreign Key part, I can simply store the parent Entity Id in the records. But it makes me wonder how to manage cascade update / cascade delete? Are the features supported in SSDS, or I have to manage them myself?<br><br>One way to avoid cascade update is to assign a unique Id to entity which cannot be changed once inserted, e.g. Identity column in SQL Server 2005, or use GUID. This leads to another question, does SSDS support Identity / auto-numbering / GUID-generation as in SQL Server 2005? Or I have to assign my own GUID from client side?<br> Sat, 07 Jun 2008 08:51:13 Z2008-06-07T08:51:13Zhttp://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/b1b147d2-dfc8-4cfd-a236-7f1172b2b2c3#2b54d2da-566f-4c60-bad0-94e6c20f360ahttp://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/b1b147d2-dfc8-4cfd-a236-7f1172b2b2c3#2b54d2da-566f-4c60-bad0-94e6c20f360aTony Petrossianhttp://social.msdn.microsoft.com/Profile/en-US/?user=Tony%20PetrossianForeign key and relationship in SSDS Currently we do not support a schema for a container and as such there is no concept of a foreign key relationship or enforcement of relationships.   <br><br>If schema support is a &quot;must have&quot; or even a &quot;nice to have&quot; for you please post note to the &quot;feedback to SSDS team&quot; thread with your requirements.  <br><br>Our feature prioritization is based on customer feedback and request so put in your vote for the stuff you want :-)<hr size="1" align="left" width="25%">TonypSun, 08 Jun 2008 04:38:21 Z2008-06-08T04:38:21Zhttp://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/b1b147d2-dfc8-4cfd-a236-7f1172b2b2c3#cb2ff5a2-fdd3-4705-a555-08d026b17bd9http://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/b1b147d2-dfc8-4cfd-a236-7f1172b2b2c3#cb2ff5a2-fdd3-4705-a555-08d026b17bd9c.c.chaihttp://social.msdn.microsoft.com/Profile/en-US/?user=c.c.chaiForeign key and relationship in SSDSSo schema is not supported. <br><br>What about the second part of my question? Does SSDS able to auto-generate Entity Id for me? e.g. Identity column or NEWID() in SQL Server 2005.  Tue, 10 Jun 2008 03:19:00 Z2008-06-10T03:19:00Zhttp://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/b1b147d2-dfc8-4cfd-a236-7f1172b2b2c3#0cebb2aa-bac5-4a56-8ba0-b8a891e62d8ehttp://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/b1b147d2-dfc8-4cfd-a236-7f1172b2b2c3#0cebb2aa-bac5-4a56-8ba0-b8a891e62d8eTony Petrossianhttp://social.msdn.microsoft.com/Profile/en-US/?user=Tony%20PetrossianForeign key and relationship in SSDS You will have to generate your own IDs.  There has been very little feedback on this item, it seems that most people are okay with generating GUIDs on the client side.<hr size="1" align="left" width="25%">TonypTue, 10 Jun 2008 04:07:19 Z2008-06-10T04:07:19Zhttp://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/b1b147d2-dfc8-4cfd-a236-7f1172b2b2c3#569d8cc0-666d-4340-b97d-23510c74a798http://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/b1b147d2-dfc8-4cfd-a236-7f1172b2b2c3#569d8cc0-666d-4340-b97d-23510c74a798scottbeehttp://social.msdn.microsoft.com/Profile/en-US/?user=scottbeeForeign key and relationship in SSDS<div class=quote><span class=quoteHeader>Tony Petrossian said:</span> <p>You will have to generate your own IDs.  There has been very little feedback on this item, it seems that most people are okay with generating GUIDs on the client side. <hr align=left width="25%" size=1> Tonyp <p></p></div><br><br> I agree most people are ok to generate the GUIDS on the client side, but it will be really nice and make things a bit easier if the service can generate GUIDs.  Anyone else wants this functionality?<hr size="1" align="left" width="25%">.scottbee.Fri, 27 Jun 2008 16:43:36 Z2008-06-27T16:43:36Zhttp://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/b1b147d2-dfc8-4cfd-a236-7f1172b2b2c3#b3957ca9-f41c-4538-8072-bd767077a25bhttp://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/b1b147d2-dfc8-4cfd-a236-7f1172b2b2c3#b3957ca9-f41c-4538-8072-bd767077a25bRoger Jenningshttp://social.msdn.microsoft.com/Profile/en-US/?user=Roger%20JenningsForeign key and relationship in SSDS GUIDs aren't very performant when used for client-side (or server-side, for that matter) joins and they contribute substantial overhead to data upload and download compared to integers.<br><br>There is a rumor circulating that schemas will be introduced in a future sprint. Once you turn on schemas, it doesn't seem to me to be big step to implementing foreign key constraints.<br><br><br><hr size="1" align="left" width="25%">--rj (<a href="http://oakleafblog.blogspot.com">OakLeaf Blog</a>)Fri, 27 Jun 2008 17:58:35 Z2008-06-27T17:58:35Zhttp://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/b1b147d2-dfc8-4cfd-a236-7f1172b2b2c3#93969cb4-2a4b-4e6e-ae3f-07881ef4b03ahttp://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/b1b147d2-dfc8-4cfd-a236-7f1172b2b2c3#93969cb4-2a4b-4e6e-ae3f-07881ef4b03aMike Amundsenhttp://social.msdn.microsoft.com/Profile/en-US/?user=Mike%20AmundsenForeign key and relationship in SSDSSince the Entities are returned in s:Id order right now, GUIDs are a non-starter.<br><br>Right now I use DateTime.UTCNow.Ticks to create a unqiue value for s:Id. I also worked up a pattern that uses the difference between the current date time and some (far out) future date as a way to create a *descending* order pattern where the most recent entries always appear at the top.<br><br>While this works when you always have code between the client and the SSDS data, they fail in cases where the SSDS data will be accessed directly.  For that, we'll need some time of SSDS-side Id generation.<br><br> <hr align=left size=1 width="25%">Mike Amundsen [http://amundsen.com/blog/]Sat, 28 Jun 2008 00:09:22 Z2008-06-28T00:09:44Z