Reopen the order from completed status

Hi All,
I am witnessing a wierd behaviour for which I need your help. Following is my status sequencing in SPRO.
NO.   STATUS.            LOWEST   HIGHEST   TRANSACTION
10      OPEN                10             50                INPR
20      DISPATCHED     20             50                INPR
30      ACCEPTED        30             60                INPR
40      CANCEL             40             50               CANC
50      MAG REVIEW    10             70                INPR
60      ETA                    40            70                INPR
70      ONSITE               70            80                INPR
80      COMPLETED      50             80               FINI
There are no authorization codes and keys attached to the statuses which means all users are allowed to see and change the statuses.
Now, when the order follows OPEN -> DISPATCHED -> MANAGER REVIEW, after manager review, I am able to see the option to set the status of DISPATCHED, ACCEPTED and CANCEL, which is correct as per the config.
But, when the order is OPEN -> ONSITE -> COMPLETED -> MANAGER REIVEW, after manager review, I am only able to see the option of ETA and ONSITE.
When I tried to debug and find out whats happening, I could see a check being performed which says that if the no. of current status(Mag review = 40) is greater than the status which we want to set (accepted = 30), then that status is not allowed.
However, this takes place only when the status of Manager review has been set from Completed. For others, this check is somehow bypassed.
One thing i observed is that when you set user status to Completed, the system status sets to Completed.
From there when you set Manager reivew, the system status changes to In Progress but it gives a warning saying do not change the status from Completed. I know this is somewhere related with the system statuses but nowhere I could find out the relation except for the one between the business transactions.
There is a lot of check happening behind the scene and its next to impossible to findout through debug as to why is this behaviour happening.
Can anyone of you please explain the reason of this strange behaviour and a work around for the same.
Expecting a reply...
Karan Merwana
Any helpful answer will surely be rewarded with points.

Hi Pepe,
Thank you for your answer. According to you, I should remove the INPR status for Manager Review. But if I remove that, then what will be the system status associated with that status. I need to associate some system status with that user status.
Also, I know that changing the status from completed to In progress should not be done technically but thats what the requirement is. We want the document to be reopened after completing it.
Thanks,
Karan

Similar Messages

  • Removing the Order from Campaign in /SAPAPO/CDPS_FDISHEU, but it is not reflecting in DS_ board.

    Hello Experts,
    we wan to create some custom logic to Remove some orders from campaign. For this we have created a function and removing the order from campaign in /SAPAPO/CDPS_FDISHEU->BEFORE method.
    but the changes which i am doing they get save immediately in DB (Without press Save from DS board).
    and also they are not getting reflected in DS Board also.
    Please let me know, If you need any further information to help me out.
    Thanks in Advance
    Ashish Gupta

    Hello Experts,
    Any clue will help, please suggest.
    Thanks,
    Ashish Gupta

  • Printing the order in CRTD status

    Hi,
    Is it possible to print the order in CRTD status.
    System is not allowing by stating error as "statusCRTD is active".
    Regards
    KRISHNAN

    Hi,
    I'm using RBDAPP01 program to process the idoc of ORDERS whose status is 64. Some idoc's are successfully processed with status as 53 and some 51 but I'm also getting some idoc's with status 64.
    Could anybody can suggest how to trouble-shoot!!!
    Thanks
    Syed
    < MODERATOR: This is an old thread. Open a thread for your specific query. Message locked. >
    Edited by: Paul Meehan on Mar 22, 2010 10:20 AM

  • Block the order from MRP

    Hi Guru
    We currently have credit blocks on a sales order - they are either a block 25 or a CR block.
    But neither block actually blocks the order from MRP - we can still buy parts and manufacture.
    Can you provide us with a block that we can use on orders that will stop them from processing until it is removed.
    Thanks
    Suresh
    Edited by: sureshsdconsult on Dec 8, 2011 7:01 AM

    Hi Suresh,
    Here i have one doubt is "25" means
    U can use credit block in sales order,  either warning msg or error msg.
    If u choice warning msg system show how much credit exceed only.
    If u choice error msg, order can't process.

  • An App is corrupt on my iPhone.  It will not delete in the usual way (jiggle then X) and it prevents the sync from completing - how can I force its removal?

    An App is corrupt on my iPhone.  It will not delete in the usual way (jiggle then X) and it prevents the sync from completing - how can I force its removal?

    Hi, Anyone who has this problem:  This is now resolved on my phone simply by the prudent timing of the phone software update to 7.1.  This update cleared the corrupt map and loaded the original - all my cares went away !!  It looks like a Restore would probably work as well, on this basis.

  • Reg.Sale order release from completed status

    Dear Experts
    We create new order type DOM for domestic sales and configured. And made one despatch for part quantity after despatching which got delevery completed automatically.I found it in sale order header "Status " tab.
    How to solve this problem. I want to make further despatch. Pls help
    thanks
    Rajakumar.K

    hi,
    if you have billed that partial quantity the system will show that
    the delivery is 'completed', but in order status it will be 'being processed' as
    u still have open items yet to be delivered.
    regards,
    anand

  • Importing data for tuple changes the order from source file - please help

    Hi all:
    I am using MDM 7.1 with the new tuple functionality. I have to import some product texts in a specific order. Tuples is working fine, the only issue is that it changes the order of the rows when importing from Excel.  Let's say I have product number
    A123, Text 1
    A123, Text 2
    A123, Text 3
    When importing in MDM I get:
    A123, Text 2
    A123, text 3
    A123, Text 1
    It is changing the order in which records are from source Excel file. Any ideas on how to force it to import in the same order as source file?
    Thanks,
    -Arturo Blasi.

    import java.util.*;
    import java.io.*;
    Student Name: Qiang Wu
    Student Number: 205722913
    public class Check05C
         public static void main(String[] args) throws IOException
              Scanner input = new Scanner(System.in);
              PrintStream output = System.out;
              output.print("Please enter filename...");
              File MarkFile = new File(input.nextLine());
              Scanner fileinput = new Scanner(MarkFile);
              double average;
              int maxmark = 0;
              int minmark = 100;
              int sum = 0;
              for (int score = fileinput.nextInt(); fileinput.hasNextInt(); score = fileinput.nextInt())
                   sum = sum + score;
                   if (score >= maxmark)
                        maxmark = score;
                   else if (score <= minmark)
                        minmark = score;
              average = (maxmark + minmark) / 2;
              output.println("Class Average is: " + average);
              output.println("Maximum mark is: " + maxmark);
              output.println("Minimum mark is: " + minmark);
              fileinput.close();
    }: ) I still cant figure out how to modify.

  • Blocking the order from subscriptions.

    Hi all,
    I got a new requirment where i need to block my orders. The Orders will be created with reference to the subscription already created.
    Once the subscription is created, i can block the subscription by executing some 'Z' programs which is using the configurations mentioned below.
    Configuration:
    IMG > Logistics Execution > Shipping > Deliveries > Define Reasons for Blocking in Shipping
    But while maintaining the above configuration it is blocking the delivery only, not the order.
    So we thought of adding a new block in the above configuration for both the order block and delivery block.
    Is there any possible user exit which i can refer to proceed furthur?.or any configuration is there thru which i can block the order.
    Neslin.

    in the insert into looping, I declare a t_row_numbering variable which is incremented everytime a row is inserted. So everytime a record is inserted, the t_row_numbering is put in the description field, telling me which the order of the row inserted.
    But, I've resolved this problem by re downloading the report from the source and modify it again. I'm just wondering what's the cause. Oh well, job goes on.

  • Help with the order from the Apple Store

    help, I made an order on the iphone 6 + and he appeared in the list of orders, pay upon receipt of goods. I have a simple question! Will I receive a product or add an item in addition to the orders must be more, to do something?

    Hi ..
    You can check your order status here >   Apple Help - Viewing and Changing Orders

  • Get the Order # from the Field VBAP-ARKTX field

    hi,
    i.Order # - for order number parse description field (VBAP-ARKTX) from the right, grab numeric values until reaching a space or ‘#’ character.
    vbap-arktx = 'LABOR'.
    vbap-arktx = 'IC,OCTAL BUFFER/DRIVER 74C240'.
    vbap-arktx = 'IC,BUS TRNCVR,OCTAL    74HC245'.
    vbap-arktx = 'AP CER .1UF 20% 100V AX T/R'.
    vbap-arktx = 'CAP,ELECT,RAD,LOESR,1000UF,16V'.
    vbap-arktx = 'SOCKET,IC,.600 DIP,40-PIN,PHBZ'.
    for the above VBAP-ARKTX Value...how to get the Order# as per the requirement.......
    kindly let me know

    Hi Deepthi...
    I am afraid that there is no safe way to do it.
    Given that you write such a code snippet, for the examples you provide the resulting order string might be like this:
    vbap-arktx = 'LABOR'.
    Order = .... nothing... no numeric values found
    vbap-arktx = 'IC,OCTAL BUFFER/DRIVER 74C240'.
    order = 74C240 or 240 or 74240 ?
    vbap-arktx = 'IC,BUS TRNCVR,OCTAL 74HC245'.
    order = 74HC245 or 245 or 74245?
    vbap-arktx = 'AP CER .1UF 20% 100V AX T/R'.
    order = ???
    vbap-arktx = 'CAP,ELECT,RAD,LOESR,1000UF,16V'.
    order = ???
    vbap-arktx = 'SOCKET,IC,.600 DIP,40-PIN,PHBZ'.
    order = ???
    As you realize, there is no way to tell if there is an order in any case.
    Regards,
    George.

  • Can I cancel the order from the istore?

    my 4years old nephew just purchased few games from the store with my iphone .I didn't know about it. now I just have to pay for it.  or can i cancel the order??

    You cannot cancel them.

  • Relese the orders from hold

    Hi All
    I have to release orders from hold(particular hold). i think we have the API OE_HOLDS_PUB.RELEASE_HOLDS but how to call this API, what are the parameters we need? if any sample code please post it. i am working on 11.5.10.2 version EBS , O/S windows
    Thanks

    See http://sanjaimisra.blogspot.com/2008/08/releasing-order-holds.html
    Hope this helps,
    Sandeep Gandhi

  • May I switch the order from stand shipping to in-store pick up?

    I make an order of iphone6plus today in stand shipping way. Is it possible to change it to a in-store pick-up? Will it be much quicker than the shipping way? Has  anybody  been through the similar situation? Thank you in advance.

    Hello MoCiWe,
    Thanks for pre-ordering at Best Buy! In Store Pickup is a great way to ensure that you’re able to play these great games on their release date. There are times when we’re unable to provide that option for certain titles, but it looks like the two titles you mentioned can be pre-ordered for Store Pickup at many locations. I may be able to switch your order, I’ll just need to confirm some details first. Please send me a private message that contains the name, phone number and email address attached to your order, along with the location of the store that you’re hoping to pick these up at. Once I can confirm the order details and item availability, I will post back with an update.
    Thanks for connecting with us on the forum, and please let me know if you have any additional questions or concerns.
    Sincerely,
    Matt|Senior Social Media Specialist | Best Buy® Corporate
     Private Message

  • How to block user to open any PO (Order) from Approval status to Worksheet

    Hi,
    Can anybody help me how to block user that he cannot bring any approved PO to worksheet status in RMS.
    Regards

    Hello,
    The following query will make sure that only a user with DEVELOPER role can see the 'Worksheet' option in the Options menu.
    Users who do not have DEVELOPER role will not see the 'Worksheet' option in the Options menu.
    You would want to make it possible for a higher privilege user to still place orders back in Worksheet status.
    insert into sec_form_action_role (sec_form_action_id,role)
    select sec_form_action_id,'DEVELOPER' as role from sec_form_action
    where form_name='FM_ORDHEAD'
    and obj_name='OPTIONS_MENU.WORKSHEET';
    Regards,
    Ramnath

  • How to update the order from 1 to .... based on start order and end order?

    Hello All,
    I have below table/data structure,
    DECLARE @TBL TABLE (START_ORD INT, END_ORD INT, ENTITY_NAME VARCHAR(10), ENTITY_ORDER INT)
    INSERT INTO @TBL VALUES
    (1, 0, 'ABC', 5),
    (1, 1, 'ABC1', 8),
    (1, 2, 'ABC2', 8),
    (3, 0, 'ABC3', 0),
    (4, 1, 'ABC4', 1)
    SELECT * FROM @TBL
    1. start order starts with 1 to .....
    2. end order starts with 0 to .....
    3. having different combination of start order & end Order (1 - 0, 1 - 1, 1 - 2, 3 - 0, 4 - 1, etc), hence order for,
    1 - 0 should be 1
    1 - 1 should be 2
    1 - 2 should be 3, etc.....
    I'm looking for below output, please suggest, Thanks!

    /****** Object: Check [CK_WorkOrder_ScrappedQty] Script Date: 04/09/2014 10:12:41 ******/
    ALTER TABLE [Production].[WorkOrder] WITH CHECK ADD CONSTRAINT [CK_WorkOrder_ScrappedQty] CHECK (([ScrappedQty]>=(0)))
    GO
    ALTER TABLE [Production].[WorkOrder] CHECK CONSTRAINT [CK_WorkOrder_ScrappedQty]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Check constraint [ScrappedQty] >= (0)' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'WorkOrder', @level2type=N'CONSTRAINT',@level2name=N'CK_WorkOrder_ScrappedQty'
    GO
    /****** Object: Check [CK_WorkOrderRouting_ActualCost] Script Date: 04/09/2014 10:12:41 ******/
    ALTER TABLE [Production].[WorkOrderRouting] WITH CHECK ADD CONSTRAINT [CK_WorkOrderRouting_ActualCost] CHECK (([ActualCost]>(0.00)))
    GO
    ALTER TABLE [Production].[WorkOrderRouting] CHECK CONSTRAINT [CK_WorkOrderRouting_ActualCost]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Check constraint [ActualCost] > (0.00)' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'WorkOrderRouting', @level2type=N'CONSTRAINT',@level2name=N'CK_WorkOrderRouting_ActualCost'
    GO
    /****** Object: Check [CK_WorkOrderRouting_ActualEndDate] Script Date: 04/09/2014 10:12:41 ******/
    ALTER TABLE [Production].[WorkOrderRouting] WITH CHECK ADD CONSTRAINT [CK_WorkOrderRouting_ActualEndDate] CHECK (([ActualEndDate]>=[ActualStartDate] OR [ActualEndDate] IS NULL OR [ActualStartDate] IS NULL))
    GO
    ALTER TABLE [Production].[WorkOrderRouting] CHECK CONSTRAINT [CK_WorkOrderRouting_ActualEndDate]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Check constraint [ActualEndDate] >= [ActualStartDate] OR [ActualEndDate] IS NULL OR [ActualStartDate] IS NULL' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'WorkOrderRouting', @level2type=N'CONSTRAINT',@level2name=N'CK_WorkOrderRouting_ActualEndDate'
    GO
    /****** Object: Check [CK_WorkOrderRouting_ActualResourceHrs] Script Date: 04/09/2014 10:12:41 ******/
    ALTER TABLE [Production].[WorkOrderRouting] WITH CHECK ADD CONSTRAINT [CK_WorkOrderRouting_ActualResourceHrs] CHECK (([ActualResourceHrs]>=(0.0000)))
    GO
    ALTER TABLE [Production].[WorkOrderRouting] CHECK CONSTRAINT [CK_WorkOrderRouting_ActualResourceHrs]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Check constraint [ActualResourceHrs] >= (0.0000)' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'WorkOrderRouting', @level2type=N'CONSTRAINT',@level2name=N'CK_WorkOrderRouting_ActualResourceHrs'
    GO
    /****** Object: Check [CK_WorkOrderRouting_PlannedCost] Script Date: 04/09/2014 10:12:41 ******/
    ALTER TABLE [Production].[WorkOrderRouting] WITH CHECK ADD CONSTRAINT [CK_WorkOrderRouting_PlannedCost] CHECK (([PlannedCost]>(0.00)))
    GO
    ALTER TABLE [Production].[WorkOrderRouting] CHECK CONSTRAINT [CK_WorkOrderRouting_PlannedCost]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Check constraint [PlannedCost] > (0.00)' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'WorkOrderRouting', @level2type=N'CONSTRAINT',@level2name=N'CK_WorkOrderRouting_PlannedCost'
    GO
    /****** Object: Check [CK_WorkOrderRouting_ScheduledEndDate] Script Date: 04/09/2014 10:12:41 ******/
    ALTER TABLE [Production].[WorkOrderRouting] WITH CHECK ADD CONSTRAINT [CK_WorkOrderRouting_ScheduledEndDate] CHECK (([ScheduledEndDate]>=[ScheduledStartDate]))
    GO
    ALTER TABLE [Production].[WorkOrderRouting] CHECK CONSTRAINT [CK_WorkOrderRouting_ScheduledEndDate]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Check constraint [ScheduledEndDate] >= [ScheduledStartDate]' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'WorkOrderRouting', @level2type=N'CONSTRAINT',@level2name=N'CK_WorkOrderRouting_ScheduledEndDate'
    GO
    /****** Object: ForeignKey [FK_Individual_Contact_ContactID] Script Date: 04/09/2014 10:12:10 ******/
    ALTER TABLE [Sales].[Individual] WITH CHECK ADD CONSTRAINT [FK_Individual_Contact_ContactID] FOREIGN KEY([ContactID])
    REFERENCES [Person].[Contact] ([ContactID])
    GO
    ALTER TABLE [Sales].[Individual] CHECK CONSTRAINT [FK_Individual_Contact_ContactID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Contact.ContactID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'Individual', @level2type=N'CONSTRAINT',@level2name=N'FK_Individual_Contact_ContactID'
    GO
    /****** Object: ForeignKey [FK_Individual_Customer_CustomerID] Script Date: 04/09/2014 10:12:10 ******/
    ALTER TABLE [Sales].[Individual] WITH CHECK ADD CONSTRAINT [FK_Individual_Customer_CustomerID] FOREIGN KEY([CustomerID])
    REFERENCES [Sales].[Customer] ([CustomerID])
    GO
    ALTER TABLE [Sales].[Individual] CHECK CONSTRAINT [FK_Individual_Customer_CustomerID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Customer.CustomerID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'Individual', @level2type=N'CONSTRAINT',@level2name=N'FK_Individual_Customer_CustomerID'
    GO
    /****** Object: ForeignKey [FK_StoreContact_Contact_ContactID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[StoreContact] WITH CHECK ADD CONSTRAINT [FK_StoreContact_Contact_ContactID] FOREIGN KEY([ContactID])
    REFERENCES [Person].[Contact] ([ContactID])
    GO
    ALTER TABLE [Sales].[StoreContact] CHECK CONSTRAINT [FK_StoreContact_Contact_ContactID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Contact.ContactID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'StoreContact', @level2type=N'CONSTRAINT',@level2name=N'FK_StoreContact_Contact_ContactID'
    GO
    /****** Object: ForeignKey [FK_StoreContact_ContactType_ContactTypeID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[StoreContact] WITH CHECK ADD CONSTRAINT [FK_StoreContact_ContactType_ContactTypeID] FOREIGN KEY([ContactTypeID])
    REFERENCES [Person].[ContactType] ([ContactTypeID])
    GO
    ALTER TABLE [Sales].[StoreContact] CHECK CONSTRAINT [FK_StoreContact_ContactType_ContactTypeID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing ContactType.ContactTypeID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'StoreContact', @level2type=N'CONSTRAINT',@level2name=N'FK_StoreContact_ContactType_ContactTypeID'
    GO
    /****** Object: ForeignKey [FK_StoreContact_Store_CustomerID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[StoreContact] WITH CHECK ADD CONSTRAINT [FK_StoreContact_Store_CustomerID] FOREIGN KEY([CustomerID])
    REFERENCES [Sales].[Store] ([CustomerID])
    GO
    ALTER TABLE [Sales].[StoreContact] CHECK CONSTRAINT [FK_StoreContact_Store_CustomerID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Store.CustomerID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'StoreContact', @level2type=N'CONSTRAINT',@level2name=N'FK_StoreContact_Store_CustomerID'
    GO
    /****** Object: ForeignKey [FK_Employee_Contact_ContactID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [HumanResources].[Employee] WITH CHECK ADD CONSTRAINT [FK_Employee_Contact_ContactID] FOREIGN KEY([ContactID])
    REFERENCES [Person].[Contact] ([ContactID])
    GO
    ALTER TABLE [HumanResources].[Employee] CHECK CONSTRAINT [FK_Employee_Contact_ContactID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Contact.ContactID.' , @level0type=N'SCHEMA',@level0name=N'HumanResources', @level1type=N'TABLE',@level1name=N'Employee', @level2type=N'CONSTRAINT',@level2name=N'FK_Employee_Contact_ContactID'
    GO
    /****** Object: ForeignKey [FK_Employee_Employee_ManagerID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [HumanResources].[Employee] WITH CHECK ADD CONSTRAINT [FK_Employee_Employee_ManagerID] FOREIGN KEY([ManagerID])
    REFERENCES [HumanResources].[Employee] ([EmployeeID])
    GO
    ALTER TABLE [HumanResources].[Employee] CHECK CONSTRAINT [FK_Employee_Employee_ManagerID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Employee.ManagerID.' , @level0type=N'SCHEMA',@level0name=N'HumanResources', @level1type=N'TABLE',@level1name=N'Employee', @level2type=N'CONSTRAINT',@level2name=N'FK_Employee_Employee_ManagerID'
    GO
    /****** Object: ForeignKey [FK_Customer_SalesTerritory_TerritoryID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[Customer] WITH CHECK ADD CONSTRAINT [FK_Customer_SalesTerritory_TerritoryID] FOREIGN KEY([TerritoryID])
    REFERENCES [Sales].[SalesTerritory] ([TerritoryID])
    GO
    ALTER TABLE [Sales].[Customer] CHECK CONSTRAINT [FK_Customer_SalesTerritory_TerritoryID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing SalesTerritory.TerritoryID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'Customer', @level2type=N'CONSTRAINT',@level2name=N'FK_Customer_SalesTerritory_TerritoryID'
    GO
    /****** Object: ForeignKey [FK_CurrencyRate_Currency_FromCurrencyCode] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[CurrencyRate] WITH CHECK ADD CONSTRAINT [FK_CurrencyRate_Currency_FromCurrencyCode] FOREIGN KEY([FromCurrencyCode])
    REFERENCES [Sales].[Currency] ([CurrencyCode])
    GO
    ALTER TABLE [Sales].[CurrencyRate] CHECK CONSTRAINT [FK_CurrencyRate_Currency_FromCurrencyCode]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Currency.FromCurrencyCode.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'CurrencyRate', @level2type=N'CONSTRAINT',@level2name=N'FK_CurrencyRate_Currency_FromCurrencyCode'
    GO
    /****** Object: ForeignKey [FK_CurrencyRate_Currency_ToCurrencyCode] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[CurrencyRate] WITH CHECK ADD CONSTRAINT [FK_CurrencyRate_Currency_ToCurrencyCode] FOREIGN KEY([ToCurrencyCode])
    REFERENCES [Sales].[Currency] ([CurrencyCode])
    GO
    ALTER TABLE [Sales].[CurrencyRate] CHECK CONSTRAINT [FK_CurrencyRate_Currency_ToCurrencyCode]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Currency.ToCurrencyCode.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'CurrencyRate', @level2type=N'CONSTRAINT',@level2name=N'FK_CurrencyRate_Currency_ToCurrencyCode'
    GO
    /****** Object: ForeignKey [FK_CountryRegionCurrency_CountryRegion_CountryRegionCode] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[CountryRegionCurrency] WITH CHECK ADD CONSTRAINT [FK_CountryRegionCurrency_CountryRegion_CountryRegionCode] FOREIGN KEY([CountryRegionCode])
    REFERENCES [Person].[CountryRegion] ([CountryRegionCode])
    GO
    ALTER TABLE [Sales].[CountryRegionCurrency] CHECK CONSTRAINT [FK_CountryRegionCurrency_CountryRegion_CountryRegionCode]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing CountryRegion.CountryRegionCode.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'CountryRegionCurrency', @level2type=N'CONSTRAINT',@level2name=N'FK_CountryRegionCurrency_CountryRegion_CountryRegionCode'
    GO
    /****** Object: ForeignKey [FK_CountryRegionCurrency_Currency_CurrencyCode] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[CountryRegionCurrency] WITH CHECK ADD CONSTRAINT [FK_CountryRegionCurrency_Currency_CurrencyCode] FOREIGN KEY([CurrencyCode])
    REFERENCES [Sales].[Currency] ([CurrencyCode])
    GO
    ALTER TABLE [Sales].[CountryRegionCurrency] CHECK CONSTRAINT [FK_CountryRegionCurrency_Currency_CurrencyCode]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Currency.CurrencyCode.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'CountryRegionCurrency', @level2type=N'CONSTRAINT',@level2name=N'FK_CountryRegionCurrency_Currency_CurrencyCode'
    GO
    /****** Object: ForeignKey [FK_ContactCreditCard_Contact_ContactID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[ContactCreditCard] WITH CHECK ADD CONSTRAINT [FK_ContactCreditCard_Contact_ContactID] FOREIGN KEY([ContactID])
    REFERENCES [Person].[Contact] ([ContactID])
    GO
    ALTER TABLE [Sales].[ContactCreditCard] CHECK CONSTRAINT [FK_ContactCreditCard_Contact_ContactID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Contact.ContactID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'ContactCreditCard', @level2type=N'CONSTRAINT',@level2name=N'FK_ContactCreditCard_Contact_ContactID'
    GO
    /****** Object: ForeignKey [FK_ContactCreditCard_CreditCard_CreditCardID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[ContactCreditCard] WITH CHECK ADD CONSTRAINT [FK_ContactCreditCard_CreditCard_CreditCardID] FOREIGN KEY([CreditCardID])
    REFERENCES [Sales].[CreditCard] ([CreditCardID])
    GO
    ALTER TABLE [Sales].[ContactCreditCard] CHECK CONSTRAINT [FK_ContactCreditCard_CreditCard_CreditCardID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing CreditCard.CreditCardID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'ContactCreditCard', @level2type=N'CONSTRAINT',@level2name=N'FK_ContactCreditCard_CreditCard_CreditCardID'
    GO
    /****** Object: ForeignKey [FK_ProductModelProductDescriptionCulture_Culture_CultureID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Production].[ProductModelProductDescriptionCulture] WITH CHECK ADD CONSTRAINT [FK_ProductModelProductDescriptionCulture_Culture_CultureID] FOREIGN KEY([CultureID])
    REFERENCES [Production].[Culture] ([CultureID])
    GO
    ALTER TABLE [Production].[ProductModelProductDescriptionCulture] CHECK CONSTRAINT [FK_ProductModelProductDescriptionCulture_Culture_CultureID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Culture.CultureID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductModelProductDescriptionCulture', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductModelProductDescriptionCulture_Culture_CultureID'
    GO
    /****** Object: ForeignKey [FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Production].[ProductModelProductDescriptionCulture] WITH CHECK ADD CONSTRAINT [FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID] FOREIGN KEY([ProductDescriptionID])
    REFERENCES [Production].[ProductDescription] ([ProductDescriptionID])
    GO
    ALTER TABLE [Production].[ProductModelProductDescriptionCulture] CHECK CONSTRAINT [FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing ProductDescription.ProductDescriptionID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductModelProductDescriptionCulture', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID'
    GO
    /****** Object: ForeignKey [FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Production].[ProductModelProductDescriptionCulture] WITH CHECK ADD CONSTRAINT [FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID] FOREIGN KEY([ProductModelID])
    REFERENCES [Production].[ProductModel] ([ProductModelID])
    GO
    ALTER TABLE [Production].[ProductModelProductDescriptionCulture] CHECK CONSTRAINT [FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing ProductModel.ProductModelID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductModelProductDescriptionCulture', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID'
    GO
    /****** Object: ForeignKey [FK_ProductModelIllustration_Illustration_IllustrationID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Production].[ProductModelIllustration] WITH CHECK ADD CONSTRAINT [FK_ProductModelIllustration_Illustration_IllustrationID] FOREIGN KEY([IllustrationID])
    REFERENCES [Production].[Illustration] ([IllustrationID])
    GO
    ALTER TABLE [Production].[ProductModelIllustration] CHECK CONSTRAINT [FK_ProductModelIllustration_Illustration_IllustrationID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Illustration.IllustrationID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductModelIllustration', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductModelIllustration_Illustration_IllustrationID'
    GO
    /****** Object: ForeignKey [FK_ProductModelIllustration_ProductModel_ProductModelID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Production].[ProductModelIllustration] WITH CHECK ADD CONSTRAINT [FK_ProductModelIllustration_ProductModel_ProductModelID] FOREIGN KEY([ProductModelID])
    REFERENCES [Production].[ProductModel] ([ProductModelID])
    GO
    ALTER TABLE [Production].[ProductModelIllustration] CHECK CONSTRAINT [FK_ProductModelIllustration_ProductModel_ProductModelID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing ProductModel.ProductModelID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductModelIllustration', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductModelIllustration_ProductModel_ProductModelID'
    GO
    /****** Object: ForeignKey [FK_ProductSubcategory_ProductCategory_ProductCategoryID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Production].[ProductSubcategory] WITH CHECK ADD CONSTRAINT [FK_ProductSubcategory_ProductCategory_ProductCategoryID] FOREIGN KEY([ProductCategoryID])
    REFERENCES [Production].[ProductCategory] ([ProductCategoryID])
    GO
    ALTER TABLE [Production].[ProductSubcategory] CHECK CONSTRAINT [FK_ProductSubcategory_ProductCategory_ProductCategoryID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing ProductCategory.ProductCategoryID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductSubcategory', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductSubcategory_ProductCategory_ProductCategoryID'
    GO
    /****** Object: ForeignKey [FK_StateProvince_CountryRegion_CountryRegionCode] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Person].[StateProvince] WITH CHECK ADD CONSTRAINT [FK_StateProvince_CountryRegion_CountryRegionCode] FOREIGN KEY([CountryRegionCode])
    REFERENCES [Person].[CountryRegion] ([CountryRegionCode])
    GO
    ALTER TABLE [Person].[StateProvince] CHECK CONSTRAINT [FK_StateProvince_CountryRegion_CountryRegionCode]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing CountryRegion.CountryRegionCode.' , @level0type=N'SCHEMA',@level0name=N'Person', @level1type=N'TABLE',@level1name=N'StateProvince', @level2type=N'CONSTRAINT',@level2name=N'FK_StateProvince_CountryRegion_CountryRegionCode'
    GO
    /****** Object: ForeignKey [FK_StateProvince_SalesTerritory_TerritoryID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Person].[StateProvince] WITH CHECK ADD CONSTRAINT [FK_StateProvince_SalesTerritory_TerritoryID] FOREIGN KEY([TerritoryID])
    REFERENCES [Sales].[SalesTerritory] ([TerritoryID])
    GO
    ALTER TABLE [Person].[StateProvince] CHECK CONSTRAINT [FK_StateProvince_SalesTerritory_TerritoryID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing SalesTerritory.TerritoryID.' , @level0type=N'SCHEMA',@level0name=N'Person', @level1type=N'TABLE',@level1name=N'StateProvince', @level2type=N'CONSTRAINT',@level2name=N'FK_StateProvince_SalesTerritory_TerritoryID'
    GO
    /****** Object: ForeignKey [FK_SalesTaxRate_StateProvince_StateProvinceID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[SalesTaxRate] WITH CHECK ADD CONSTRAINT [FK_SalesTaxRate_StateProvince_StateProvinceID] FOREIGN KEY([StateProvinceID])
    REFERENCES [Person].[StateProvince] ([StateProvinceID])
    GO
    ALTER TABLE [Sales].[SalesTaxRate] CHECK CONSTRAINT [FK_SalesTaxRate_StateProvince_StateProvinceID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing StateProvince.StateProvinceID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SalesTaxRate', @level2type=N'CONSTRAINT',@level2name=N'FK_SalesTaxRate_StateProvince_StateProvinceID'
    GO
    /****** Object: ForeignKey [FK_Store_Customer_CustomerID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[Store] WITH CHECK ADD CONSTRAINT [FK_Store_Customer_CustomerID] FOREIGN KEY([CustomerID])
    REFERENCES [Sales].[Customer] ([CustomerID])
    GO
    ALTER TABLE [Sales].[Store] CHECK CONSTRAINT [FK_Store_Customer_CustomerID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Customer.CustomerID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'Store', @level2type=N'CONSTRAINT',@level2name=N'FK_Store_Customer_CustomerID'
    GO
    /****** Object: ForeignKey [FK_Store_SalesPerson_SalesPersonID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[Store] WITH CHECK ADD CONSTRAINT [FK_Store_SalesPerson_SalesPersonID] FOREIGN KEY([SalesPersonID])
    REFERENCES [Sales].[SalesPerson] ([SalesPersonID])
    GO
    ALTER TABLE [Sales].[Store] CHECK CONSTRAINT [FK_Store_SalesPerson_SalesPersonID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing SalesPerson.SalesPersonID' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'Store', @level2type=N'CONSTRAINT',@level2name=N'FK_Store_SalesPerson_SalesPersonID'
    GO
    /****** Object: ForeignKey [FK_SalesPerson_Employee_SalesPersonID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[SalesPerson] WITH CHECK ADD CONSTRAINT [FK_SalesPerson_Employee_SalesPersonID] FOREIGN KEY([SalesPersonID])
    REFERENCES [HumanResources].[Employee] ([EmployeeID])
    GO
    ALTER TABLE [Sales].[SalesPerson] CHECK CONSTRAINT [FK_SalesPerson_Employee_SalesPersonID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Employee.EmployeeID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SalesPerson', @level2type=N'CONSTRAINT',@level2name=N'FK_SalesPerson_Employee_SalesPersonID'
    GO
    /****** Object: ForeignKey [FK_SalesPerson_SalesTerritory_TerritoryID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[SalesPerson] WITH CHECK ADD CONSTRAINT [FK_SalesPerson_SalesTerritory_TerritoryID] FOREIGN KEY([TerritoryID])
    REFERENCES [Sales].[SalesTerritory] ([TerritoryID])
    GO
    ALTER TABLE [Sales].[SalesPerson] CHECK CONSTRAINT [FK_SalesPerson_SalesTerritory_TerritoryID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing SalesTerritory.TerritoryID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SalesPerson', @level2type=N'CONSTRAINT',@level2name=N'FK_SalesPerson_SalesTerritory_TerritoryID'
    GO
    /****** Object: ForeignKey [FK_PurchaseOrderHeader_Employee_EmployeeID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Purchasing].[PurchaseOrderHeader] WITH CHECK ADD CONSTRAINT [FK_PurchaseOrderHeader_Employee_EmployeeID] FOREIGN KEY([EmployeeID])
    REFERENCES [HumanResources].[Employee] ([EmployeeID])
    GO
    ALTER TABLE [Purchasing].[PurchaseOrderHeader] CHECK CONSTRAINT [FK_PurchaseOrderHeader_Employee_EmployeeID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Employee.EmployeeID.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'PurchaseOrderHeader', @level2type=N'CONSTRAINT',@level2name=N'FK_PurchaseOrderHeader_Employee_EmployeeID'
    GO
    /****** Object: ForeignKey [FK_PurchaseOrderHeader_ShipMethod_ShipMethodID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Purchasing].[PurchaseOrderHeader] WITH CHECK ADD CONSTRAINT [FK_PurchaseOrderHeader_ShipMethod_ShipMethodID] FOREIGN KEY([ShipMethodID])
    REFERENCES [Purchasing].[ShipMethod] ([ShipMethodID])
    GO
    ALTER TABLE [Purchasing].[PurchaseOrderHeader] CHECK CONSTRAINT [FK_PurchaseOrderHeader_ShipMethod_ShipMethodID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing ShipMethod.ShipMethodID.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'PurchaseOrderHeader', @level2type=N'CONSTRAINT',@level2name=N'FK_PurchaseOrderHeader_ShipMethod_ShipMethodID'
    GO
    /****** Object: ForeignKey [FK_PurchaseOrderHeader_Vendor_VendorID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Purchasing].[PurchaseOrderHeader] WITH CHECK ADD CONSTRAINT [FK_PurchaseOrderHeader_Vendor_VendorID] FOREIGN KEY([VendorID])
    REFERENCES [Purchasing].[Vendor] ([VendorID])
    GO
    ALTER TABLE [Purchasing].[PurchaseOrderHeader] CHECK CONSTRAINT [FK_PurchaseOrderHeader_Vendor_VendorID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Vendor.VendorID.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'PurchaseOrderHeader', @level2type=N'CONSTRAINT',@level2name=N'FK_PurchaseOrderHeader_Vendor_VendorID'
    GO
    /****** Object: ForeignKey [FK_Product_ProductModel_ProductModelID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Production].[Product] WITH CHECK ADD CONSTRAINT [FK_Product_ProductModel_ProductModelID] FOREIGN KEY([ProductModelID])
    REFERENCES [Production].[ProductModel] ([ProductModelID])
    GO
    ALTER TABLE [Production].[Product] CHECK CONSTRAINT [FK_Product_ProductModel_ProductModelID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing ProductModel.ProductModelID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'Product', @level2type=N'CONSTRAINT',@level2name=N'FK_Product_ProductModel_ProductModelID'
    GO
    /****** Object: ForeignKey [FK_Product_ProductSubcategory_ProductSubcategoryID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Production].[Product] WITH CHECK ADD CONSTRAINT [FK_Product_ProductSubcategory_ProductSubcategoryID] FOREIGN KEY([ProductSubcategoryID])
    REFERENCES [Production].[ProductSubcategory] ([ProductSubcategoryID])
    GO
    ALTER TABLE [Production].[Product] CHECK CONSTRAINT [FK_Product_ProductSubcategory_ProductSubcategoryID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing ProductSubcategory.ProductSubcategoryID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'Product', @level2type=N'CONSTRAINT',@level2name=N'FK_Product_ProductSubcategory_ProductSubcategoryID'
    GO
    /****** Object: ForeignKey [FK_Product_UnitMeasure_SizeUnitMeasureCode] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Production].[Product] WITH CHECK ADD CONSTRAINT [FK_Product_UnitMeasure_SizeUnitMeasureCode] FOREIGN KEY([SizeUnitMeasureCode])
    REFERENCES [Production].[UnitMeasure] ([UnitMeasureCode])
    GO
    ALTER TABLE [Production].[Product] CHECK CONSTRAINT [FK_Product_UnitMeasure_SizeUnitMeasureCode]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing UnitMeasure.UnitMeasureCode.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'Product', @level2type=N'CONSTRAINT',@level2name=N'FK_Product_UnitMeasure_SizeUnitMeasureCode'
    GO
    /****** Object: ForeignKey [FK_Product_UnitMeasure_WeightUnitMeasureCode] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Production].[Product] WITH CHECK ADD CONSTRAINT [FK_Product_UnitMeasure_WeightUnitMeasureCode] FOREIGN KEY([WeightUnitMeasureCode])
    REFERENCES [Production].[UnitMeasure] ([UnitMeasureCode])
    GO
    ALTER TABLE [Production].[Product] CHECK CONSTRAINT [FK_Product_UnitMeasure_WeightUnitMeasureCode]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing UnitMeasure.UnitMeasureCode.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'Product', @level2type=N'CONSTRAINT',@level2name=N'FK_Product_UnitMeasure_WeightUnitMeasureCode'
    GO
    /****** Object: ForeignKey [FK_Address_StateProvince_StateProvinceID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Person].[Address] WITH CHECK ADD CONSTRAINT [FK_Address_StateProvince_StateProvinceID] FOREIGN KEY([StateProvinceID])
    REFERENCES [Person].[StateProvince] ([StateProvinceID])
    GO
    ALTER TABLE [Person].[Address] CHECK CONSTRAINT [FK_Address_StateProvince_StateProvinceID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing StateProvince.StateProvinceID.' , @level0type=N'SCHEMA',@level0name=N'Person', @level1type=N'TABLE',@level1name=N'Address', @level2type=N'CONSTRAINT',@level2name=N'FK_Address_StateProvince_StateProvinceID'
    GO
    /****** Object: ForeignKey [FK_JobCandidate_Employee_EmployeeID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [HumanResources].[JobCandidate] WITH CHECK ADD CONSTRAINT [FK_JobCandidate_Employee_EmployeeID] FOREIGN KEY([EmployeeID])
    REFERENCES [HumanResources].[Employee] ([EmployeeID])
    GO
    ALTER TABLE [HumanResources].[JobCandidate] CHECK CONSTRAINT [FK_JobCandidate_Employee_EmployeeID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Employee.EmployeeID.' , @level0type=N'SCHEMA',@level0name=N'HumanResources', @level1type=N'TABLE',@level1name=N'JobCandidate', @level2type=N'CONSTRAINT',@level2name=N'FK_JobCandidate_Employee_EmployeeID'
    GO
    /****** Object: ForeignKey [FK_EmployeePayHistory_Employee_EmployeeID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [HumanResources].[EmployeePayHistory] WITH CHECK ADD CONSTRAINT [FK_EmployeePayHistory_Employee_EmployeeID] FOREIGN KEY([EmployeeID])
    REFERENCES [HumanResources].[Employee] ([EmployeeID])
    GO
    ALTER TABLE [HumanResources].[EmployeePayHistory] CHECK CONSTRAINT [FK_EmployeePayHistory_Employee_EmployeeID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Employee.EmployeeID.' , @level0type=N'SCHEMA',@level0name=N'HumanResources', @level1type=N'TABLE',@level1name=N'EmployeePayHistory', @level2type=N'CONSTRAINT',@level2name=N'FK_EmployeePayHistory_Employee_EmployeeID'
    GO
    /****** Object: ForeignKey [FK_EmployeeDepartmentHistory_Department_DepartmentID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [HumanResources].[EmployeeDepartmentHistory] WITH CHECK ADD CONSTRAINT [FK_EmployeeDepartmentHistory_Department_DepartmentID] FOREIGN KEY([DepartmentID])
    REFERENCES [HumanResources].[Department] ([DepartmentID])
    GO
    ALTER TABLE [HumanResources].[EmployeeDepartmentHistory] CHECK CONSTRAINT [FK_EmployeeDepartmentHistory_Department_DepartmentID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Department.DepartmentID.' , @level0type=N'SCHEMA',@level0name=N'HumanResources', @level1type=N'TABLE',@level1name=N'EmployeeDepartmentHistory', @level2type=N'CONSTRAINT',@level2name=N'FK_EmployeeDepartmentHistory_Department_DepartmentID'
    GO
    /****** Object: ForeignKey [FK_EmployeeDepartmentHistory_Employee_EmployeeID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [HumanResources].[EmployeeDepartmentHistory] WITH CHECK ADD CONSTRAINT [FK_EmployeeDepartmentHistory_Employee_EmployeeID] FOREIGN KEY([EmployeeID])
    REFERENCES [HumanResources].[Employee] ([EmployeeID])
    GO
    ALTER TABLE [HumanResources].[EmployeeDepartmentHistory] CHECK CONSTRAINT [FK_EmployeeDepartmentHistory_Employee_EmployeeID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Employee.EmployeeID.' , @level0type=N'SCHEMA',@level0name=N'HumanResources', @level1type=N'TABLE',@level1name=N'EmployeeDepartmentHistory', @level2type=N'CONSTRAINT',@level2name=N'FK_EmployeeDepartmentHistory_Employee_EmployeeID'
    GO
    /****** Object: ForeignKey [FK_EmployeeDepartmentHistory_Shift_ShiftID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [HumanResources].[EmployeeDepartmentHistory] WITH CHECK ADD CONSTRAINT [FK_EmployeeDepartmentHistory_Shift_ShiftID] FOREIGN KEY([ShiftID])
    REFERENCES [HumanResources].[Shift] ([ShiftID])
    GO
    ALTER TABLE [HumanResources].[EmployeeDepartmentHistory] CHECK CONSTRAINT [FK_EmployeeDepartmentHistory_Shift_ShiftID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Shift.ShiftID' , @level0type=N'SCHEMA',@level0name=N'HumanResources', @level1type=N'TABLE',@level1name=N'EmployeeDepartmentHistory', @level2type=N'CONSTRAINT',@level2name=N'FK_EmployeeDepartmentHistory_Shift_ShiftID'
    GO
    /****** Object: ForeignKey [FK_VendorContact_Contact_ContactID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Purchasing].[VendorContact] WITH CHECK ADD CONSTRAINT [FK_VendorContact_Contact_ContactID] FOREIGN KEY([ContactID])
    REFERENCES [Person].[Contact] ([ContactID])
    GO
    ALTER TABLE [Purchasing].[VendorContact] CHECK CONSTRAINT [FK_VendorContact_Contact_ContactID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Contact.ContactID.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'VendorContact', @level2type=N'CONSTRAINT',@level2name=N'FK_VendorContact_Contact_ContactID'
    GO
    /****** Object: ForeignKey [FK_VendorContact_ContactType_ContactTypeID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Purchasing].[VendorContact] WITH CHECK ADD CONSTRAINT [FK_VendorContact_ContactType_ContactTypeID] FOREIGN KEY([ContactTypeID])
    REFERENCES [Person].[ContactType] ([ContactTypeID])
    GO
    ALTER TABLE [Purchasing].[VendorContact] CHECK CONSTRAINT [FK_VendorContact_ContactType_ContactTypeID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing ContactType.ContactTypeID.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'VendorContact', @level2type=N'CONSTRAINT',@level2name=N'FK_VendorContact_ContactType_ContactTypeID'
    GO
    /****** Object: ForeignKey [FK_VendorContact_Vendor_VendorID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Purchasing].[VendorContact] WITH CHECK ADD CONSTRAINT [FK_VendorContact_Vendor_VendorID] FOREIGN KEY([VendorID])
    REFERENCES [Purchasing].[Vendor] ([VendorID])
    GO
    ALTER TABLE [Purchasing].[VendorContact] CHECK CONSTRAINT [FK_VendorContact_Vendor_VendorID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Vendor.VendorID.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'VendorContact', @level2type=N'CONSTRAINT',@level2name=N'FK_VendorContact_Vendor_VendorID'
    GO
    /****** Object: ForeignKey [FK_ProductVendor_Product_ProductID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Purchasing].[ProductVendor] WITH CHECK ADD CONSTRAINT [FK_ProductVendor_Product_ProductID] FOREIGN KEY([ProductID])
    REFERENCES [Production].[Product] ([ProductID])
    GO
    ALTER TABLE [Purchasing].[ProductVendor] CHECK CONSTRAINT [FK_ProductVendor_Product_ProductID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Product.ProductID.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'ProductVendor', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductVendor_Product_ProductID'
    GO
    /****** Object: ForeignKey [FK_ProductVendor_UnitMeasure_UnitMeasureCode] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Purchasing].[ProductVendor] WITH CHECK ADD CONSTRAINT [FK_ProductVendor_UnitMeasure_UnitMeasureCode] FOREIGN KEY([UnitMeasureCode])
    REFERENCES [Production].[UnitMeasure] ([UnitMeasureCode])
    GO
    ALTER TABLE [Purchasing].[ProductVendor] CHECK CONSTRAINT [FK_ProductVendor_UnitMeasure_UnitMeasureCode]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing UnitMeasure.UnitMeasureCode.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'ProductVendor', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductVendor_UnitMeasure_UnitMeasureCode'
    GO
    /****** Object: ForeignKey [FK_ProductVendor_Vendor_VendorID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Purchasing].[ProductVendor] WITH CHECK ADD CONSTRAINT [FK_ProductVendor_Vendor_VendorID] FOREIGN KEY([VendorID])
    REFERENCES [Purchasing].[Vendor] ([VendorID])
    GO
    ALTER TABLE [Purchasing].[ProductVendor] CHECK CONSTRAINT [FK_ProductVendor_Vendor_VendorID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Vendor.VendorID.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'ProductVendor', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductVendor_Vendor_VendorID'
    GO
    /****** Object: ForeignKey [FK_VendorAddress_Address_AddressID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Purchasing].[VendorAddress] WITH CHECK ADD CONSTRAINT [FK_VendorAddress_Address_AddressID] FOREIGN KEY([AddressID])
    REFERENCES [Person].[Address] ([AddressID])
    GO
    ALTER TABLE [Purchasing].[VendorAddress] CHECK CONSTRAINT [FK_VendorAddress_Address_AddressID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Address.AddressID.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'VendorAddress', @level2type=N'CONSTRAINT',@level2name=N'FK_VendorAddress_Address_AddressID'
    GO
    /****** Object: ForeignKey [FK_VendorAddress_AddressType_AddressTypeID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Purchasing].[VendorAddress] WITH CHECK ADD CONSTRAINT [FK_VendorAddress_AddressType_AddressTypeID] FOREIGN KEY([AddressTypeID])
    REFERENCES [Person].[AddressType] ([AddressTypeID])
    GO
    ALTER TABLE [Purchasing].[VendorAddress] CHECK CONSTRAINT [FK_VendorAddress_AddressType_AddressTypeID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing AddressType.AddressTypeID.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'VendorAddress', @level2type=N'CONSTRAINT',@level2name=N'FK_VendorAddress_AddressType_AddressTypeID'
    GO
    /****** Object: ForeignKey [FK_VendorAddress_Vendor_VendorID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Purchasing].[VendorAddress] WITH CHECK ADD CONSTRAINT [FK_VendorAddress_Vendor_VendorID] FOREIGN KEY([VendorID])
    REFERENCES [Purchasing].[Vendor] ([VendorID])
    GO
    ALTER TABLE [Purchasing].[VendorAddress] CHECK CONSTRAINT [FK_VendorAddress_Vendor_VendorID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Vendor.VendorID.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'VendorAddress', @level2type=N'CONSTRAINT',@level2name=N'FK_VendorAddress_Vendor_VendorID'
    GO
    /****** Object: ForeignKey [FK_EmployeeAddress_Address_AddressID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [HumanResources].[EmployeeAddress] WITH CHECK ADD CONSTRAINT [FK_EmployeeAddress_Address_AddressID] FOREIGN KEY([AddressID])
    REFERENCES [Person].[Address] ([AddressID])
    GO
    ALTER TABLE [HumanResources].[EmployeeAddress] CHECK CONSTRAINT [FK_EmployeeAddress_Address_AddressID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Address.AddressID.' , @level0type=N'SCHEMA',@level0name=N'HumanResources', @level1type=N'TABLE',@level1name=N'EmployeeAddress', @level2type=N'CONSTRAINT',@level2name=N'FK_EmployeeAddress_Address_AddressID'
    GO
    /****** Object: ForeignKey [FK_EmployeeAddress_Employee_EmployeeID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [HumanResources].[EmployeeAddress] WITH CHECK ADD CONSTRAINT [FK_EmployeeAddress_Employee_EmployeeID] FOREIGN KEY([EmployeeID])
    REFERENCES [HumanResources].[Employee] ([EmployeeID])
    GO
    ALTER TABLE [HumanResources].[EmployeeAddress] CHECK CONSTRAINT [FK_EmployeeAddress_Employee_EmployeeID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Employee.EmployeeID.' , @level0type=N'SCHEMA',@level0name=N'HumanResources', @level1type=N'TABLE',@level1name=N'EmployeeAddress', @level2type=N'CONSTRAINT',@level2name=N'FK_EmployeeAddress_Employee_EmployeeID'
    GO
    /****** Object: ForeignKey [FK_BillOfMaterials_Product_ComponentID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Production].[BillOfMaterials] WITH CHECK ADD CONSTRAINT [FK_BillOfMaterials_Product_ComponentID] FOREIGN KEY([ComponentID])
    REFERENCES [Production].[Product] ([ProductID])
    GO
    ALTER TABLE [Production].[BillOfMaterials] CHECK CONSTRAINT [FK_BillOfMaterials_Product_ComponentID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Product.ComponentID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'BillOfMaterials', @level2type=N'CONSTRAINT',@level2name=N'FK_BillOfMaterials_Product_ComponentID'
    GO
    /****** Object: ForeignKey [FK_BillOfMaterials_Product_ProductAssemblyID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Production].[BillOfMaterials] WITH CHECK ADD CONSTRAINT [FK_BillOfMaterials_Product_ProductAssemblyID] FOREIGN KEY([ProductAssemblyID])
    REFERENCES [Production].[Product] ([ProductID])
    GO
    ALTER TABLE [Production].[BillOfMaterials] CHECK CONSTRAINT [FK_BillOfMaterials_Product_ProductAssemblyID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Product.ProductAssemblyID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'BillOfMaterials', @level2type=N'CONSTRAINT',@level2name=N'FK_BillOfMaterials_Product_ProductAssemblyID'
    GO
    /****** Object: ForeignKey [FK_BillOfMaterials_UnitMeasure_UnitMeasureCode] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Production].[BillOfMaterials] WITH CHECK ADD CONSTRAINT [FK_BillOfMaterials_UnitMeasure_UnitMeasureCode] FOREIGN KEY([UnitMeasureCode])
    REFERENCES [Production].[UnitMeasure] ([UnitMeasureCode])
    GO
    ALTER TABLE [Production].[BillOfMaterials] CHECK CONSTRAINT [FK_BillOfMaterials_UnitMeasure_UnitMeasureCode]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing UnitMeasure.UnitMeasureCode.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'BillOfMaterials', @level2type=N'CONSTRAINT',@level2name=N'FK_BillOfMaterials_UnitMeasure_UnitMeasureCode'
    GO
    /****** Object: ForeignKey [FK_ProductCostHistory_Product_ProductID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Production].[ProductCostHistory] WITH CHECK ADD CONSTRAINT [FK_ProductCostHistory_Product_ProductID] FOREIGN KEY([ProductID])
    REFERENCES [Production].[Product] ([ProductID])
    GO
    ALTER TABLE [Production].[ProductCostHistory] CHECK CONSTRAINT [FK_ProductCostHistory_Product_ProductID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Product.ProductID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductCostHistory', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductCostHistory_Product_ProductID'
    GO
    /****** Object: ForeignKey [FK_CustomerAddress_Address_AddressID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[CustomerAddress] WITH CHECK ADD CONSTRAINT [FK_CustomerAddress_Address_AddressID] FOREIGN KEY([AddressID])
    REFERENCES [Person].[Address] ([AddressID])
    GO
    ALTER TABLE [Sales].[CustomerAddress] CHECK CONSTRAINT [FK_CustomerAddress_Address_AddressID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Address.AddressID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'CustomerAddress', @level2type=N'CONSTRAINT',@level2name=N'FK_CustomerAddress_Address_AddressID'
    GO
    /****** Object: ForeignKey [FK_CustomerAddress_AddressType_AddressTypeID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[CustomerAddress] WITH CHECK ADD CONSTRAINT [FK_CustomerAddress_AddressType_AddressTypeID] FOREIGN KEY([AddressTypeID])
    REFERENCES [Person].[AddressType] ([AddressTypeID])
    GO
    ALTER TABLE [Sales].[CustomerAddress] CHECK CONSTRAINT [FK_CustomerAddress_AddressType_AddressTypeID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing AddressType.AddressTypeID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'CustomerAddress', @level2type=N'CONSTRAINT',@level2name=N'FK_CustomerAddress_AddressType_AddressTypeID'
    GO
    /****** Object: ForeignKey [FK_CustomerAddress_Customer_CustomerID] Script Date: 04/09/2014 10:12:40 ******/
    ALTER TABLE [Sales].[CustomerAddress] WITH CHECK ADD CONSTRAINT [FK_CustomerAddress_Customer_CustomerID] FOREIGN KEY([CustomerID])
    REFERENCES [Sales].[Customer] ([CustomerID])
    GO
    ALTER TABLE [Sales].[CustomerAddress] CHECK CONSTRAINT [FK_CustomerAddress_Customer_CustomerID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Customer.CustomerID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'CustomerAddress', @level2type=N'CONSTRAINT',@level2name=N'FK_CustomerAddress_Customer_CustomerID'
    GO
    /****** Object: ForeignKey [FK_ProductReview_Product_ProductID] Script Date: 04/09/2014 10:12:41 ******/
    ALTER TABLE [Production].[ProductReview] WITH CHECK ADD CONSTRAINT [FK_ProductReview_Product_ProductID] FOREIGN KEY([ProductID])
    REFERENCES [Production].[Product] ([ProductID])
    GO
    ALTER TABLE [Production].[ProductReview] CHECK CONSTRAINT [FK_ProductReview_Product_ProductID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Product.ProductID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductReview', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductReview_Product_ProductID'
    GO
    /****** Object: ForeignKey [FK_ProductProductPhoto_Product_ProductID] Script Date: 04/09/2014 10:12:41 ******/
    ALTER TABLE [Production].[ProductProductPhoto] WITH CHECK ADD CONSTRAINT [FK_ProductProductPhoto_Product_ProductID] FOREIGN KEY([ProductID])
    REFERENCES [Production].[Product] ([ProductID])
    GO
    ALTER TABLE [Production].[ProductProductPhoto] CHECK CONSTRAINT [FK_ProductProductPhoto_Product_ProductID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Product.ProductID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductProductPhoto', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductProductPhoto_Product_ProductID'
    GO
    /****** Object: ForeignKey [FK_ProductProductPhoto_ProductPhoto_ProductPhotoID] Script Date: 04/09/2014 10:12:41 ******/
    ALTER TABLE [Production].[ProductProductPhoto] WITH CHECK ADD CONSTRAINT [FK_ProductProductPhoto_ProductPhoto_ProductPhotoID] FOREIGN KEY([ProductPhotoID])
    REFERENCES [Production].[ProductPhoto] ([ProductPhotoID])
    GO
    ALTER TABLE [Production].[ProductProductPhoto] CHECK CONSTRAINT [FK_ProductProductPhoto_ProductPhoto_ProductPhotoID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing ProductPhoto.ProductPhotoID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductProductPhoto', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductProductPhoto_ProductPhoto_ProductPhotoID'
    GO
    /****** Object: ForeignKey [FK_ProductListPriceHistory_Product_ProductID] Script Date: 04/09/2014 10:12:41 ******/
    ALTER TABLE [Production].[ProductListPriceHistory] WITH CHECK ADD CONSTRAINT [FK_ProductListPriceHistory_Product_ProductID] FOREIGN KEY([ProductID])
    REFERENCES [Production].[Product] ([ProductID])
    GO
    ALTER TABLE [Production].[ProductListPriceHistory] CHECK CONSTRAINT [FK_ProductListPriceHistory_Product_ProductID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Product.ProductID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductListPriceHistory', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductListPriceHistory_Product_ProductID'
    GO
    /****** Object: ForeignKey [FK_ProductInventory_Location_LocationID] Script Date: 04/09/2014 10:12:41 ******/
    ALTER TABLE [Production].[ProductInventory] WITH CHECK ADD CONSTRAINT [FK_ProductInventory_Location_LocationID] FOREIGN KEY([LocationID])
    REFERENCES [Production].[Location] ([LocationID])
    GO
    ALTER TABLE [Production].[ProductInventory] CHECK CONSTRAINT [FK_ProductInventory_Location_LocationID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Location.LocationID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductInventory', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductInventory_Location_LocationID'
    GO
    /****** Object: ForeignKey [FK_ProductInventory_Product_ProductID] Script Date: 04/09/2014 10:12:41 ******/
    ALTER TABLE [Production].[ProductInventory] WITH CHECK ADD CONSTRAINT [FK_ProductInventory_Product_ProductID] FOREIGN KEY([ProductID])
    REFERENCES [Production].[Product] ([ProductID])
    GO
    ALTER TABLE [Production].[ProductInventory] CHECK CONSTRAINT [FK_ProductInventory_Product_ProductID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Product.ProductID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductInventory', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductInventory_Product_ProductID'
    GO
    /****** Object: ForeignKey [FK_ProductDocument_Document_DocumentID] Script Date: 04/09/2014 10:12:41 ******/
    ALTER TABLE [Production].[ProductDocument] WITH CHECK ADD CONSTRAINT [FK_ProductDocument_Document_DocumentID] FOREIGN KEY([DocumentID])
    REFERENCES [Production].[Document] ([DocumentID])
    GO
    ALTER TABLE [Production].[ProductDocument] CHECK CONSTRAINT [FK_ProductDocument_Document_DocumentID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Document.DocumentID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductDocument', @level2type=N'CONSTRAINT',@level2name=N'FK_ProductDocument_Document_DocumentID'
    GO
    /****** Object: ForeignKey [FK_ProductDocument_Product_ProductID] Script Date: 04/09/2014 10:12:41 ******/

Maybe you are looking for

  • Replacing a JLabel

    Hello I�ve got a problem with replacing a JLabel. I know it�s unusual to replace a JLabel, but I�ve got a class interpreting internal Error-Codes into �userfriendly messages�. And not only the Text is changing but also the background- and foreground-

  • Premiere Elements 12 starts then automatically exit

    I have just bought Adobe Premiere Elements 12 (full version) with the given serial number. I installed to a legal, activated Windows 7 Professional English 64bit. I also installed QuickTime 7 (latest version). I signed in with my adobe account. I run

  • RuntimeException in Message-Mapping transformation: Runtime exception durin

    Hi Friends, Iam going test Message Mapping, i got the error like   RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns0:LeapIndent_R3_MT/Recordset/RowData/QTY_TNS. The message is: Exception

  • Graphical glitch

    When I look at itunes, sometimes the items have a graphical glitch. Sort of doubling themselves, and just straight out looking wrong. When I take a screenshot, the screenshot has no glitches, but the actual screen does. Heres a picture I took of the

  • Problem with my Canvas Viewer

    Never had this problem before in over 8 years of Final cut editing... No images appear in my canvas viewer when I am editing! The canvas viewer is there, but no images appear when the playback is idol. Obviously this is pain in the neck if I want to