﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by Andy Warren / Article Discussions / Article Discussions by Author  / Foreign Keys, Part 1 - SQL School Video / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 05:23:55 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Foreign Keys, Part 1 - SQL School Video</title><link>http://www.sqlservercentral.com/Forums/Topic743576-29-1.aspx</link><description>For that, I make the OrderID an internal column the users never see. This way, they'll never update it. Then, for the foreign key, specify Enforce Foreign Key Constraints and Cascade for the delete rule.This way, the database will forbid an Order Detail that's not connected to an Order, and if an order is deleted, the details will go away too. Sometimes, you want to restrict a delete, like, don't delete a customer that has orders, but the foreign key constraint doesn't do that for you.</description><pubDate>Wed, 22 Jul 2009 07:01:26 GMT</pubDate><dc:creator>Half Bubble</dc:creator></item><item><title>RE: Foreign Keys, Part 1 - SQL School Video</title><link>http://www.sqlservercentral.com/Forums/Topic743576-29-1.aspx</link><description>Nice Video and a good intro to foreign keys. My interest in FK's are more specifically related to the deletion of data between joined tables. Eg. Table 1 - OrdersTable 2 - OrdersDetails(FK most likely would be the OrderID i assume?)A new follow up video would be very helpful to show how the deletion of status changes of this type of data would work? If you deleted an Order from the Orders primary table, do FK's automatically delete the corresponding rows of data? Or does an error occur and stop the deletion of the primary record from the Orders table?I guess i am looking for the best method to adopt when updating data between multiples tables.</description><pubDate>Tue, 21 Jul 2009 17:59:06 GMT</pubDate><dc:creator>bkirk</dc:creator></item><item><title>RE: Foreign Keys, Part 1 - SQL School Video</title><link>http://www.sqlservercentral.com/Forums/Topic743576-29-1.aspx</link><description>Do you then build in index on the "foreign key" column, or does the foreign key constraint take care of that?</description><pubDate>Tue, 21 Jul 2009 08:02:25 GMT</pubDate><dc:creator>Half Bubble</dc:creator></item><item><title>Foreign Keys, Part 1 - SQL School Video</title><link>http://www.sqlservercentral.com/Forums/Topic743576-29-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/Video/67327/"&gt;Foreign Keys, Part 1 - SQL School Video&lt;/A&gt;[/B]</description><pubDate>Mon, 29 Jun 2009 06:43:54 GMT</pubDate><dc:creator>Andy Warren</dc:creator></item></channel></rss>