Validation on start date and end date .

Hi every body ,
Hi have a problem on validation on the start date & end date problem.
I have taken two *<h:inputText>* & one *<t:commandLink>* controls.When I am clicking on the <t:commandLink> control I want to validate that end date should greater than start date .Could any body help me out from this problem .
Here is my code :
<rich:dataTable id="dataTable" 
                           value="#{adminBacking.dataModel}"
                           var="item">
   <h:column>
     <f:facet name="header">
          <h:outputText value="Start Date" />
     </f:facet>
     <h:inputText size="11" id="startDate" value="#{item.startDate}" onclick="showCalendarControl(this);" />                      </h:column>
<h:column >
     <f:facet name="header">
          <h:outputText value="End Date" />
     </f:facet>
     <h:inputText size="11" id="endDate" value="#{item.endDate}" onclick="showCalendarControl(this);" />
</h:column>
<h:column>
     <f:facet name="header">
          <h:outputText value="Update Row" />
     </f:facet>
     <t:commandLink id="update" action="#{adminBacking.updateEvent}"  value="Update" />     
</h:column>
</rich:dataTable>**Here I am taking the date by a simple date picker in the start date & end date field.
Thanks ,
sb

You may find this example useful: [http://balusc.blogspot.com/2007/12/validator-for-multiple-fields.html].

Similar Messages

  • Difference between Start Routine  and End Routine in Transformations

    Hi  Friends,
      I'm using BI 7.0... here in Transformations step  we have two options..that is START ROUTINE... and END ROUTINE... What is the Difference between Start Routine  and End Routine in Transformations..
       When  we go for Start Routine.. and when we go for End Routine..
    Plz clarrify... points will be rearded..
    thanks
    babu

    Hi,
    One real time scenario for End Routine.
    We have a scenario where in a datasource field is mapped to three infoobjects on the datatarget side. There are 2 key figures which need to get data after these these Infoobjects are filled. The best place for this to happen would be in a End Routine, where in we would loop through the results package and using the values of the infoobjects from the data target ( Cube in this case).
    Hope this helps,
    HD

  • ESS Working Time - Start Time  and End Time in Weekly View

    Hello,
    I'm having a problem with the business package ESS - functionality Working Time (cat2).
    I need that information to Start Time and End Time appear in the Weekly View of the portal.
    In Daily View that information are already visible, but In Weekly View that information does not appear.
    Does anyone have any suggestions?
    Thank you very much your attention.
    Att,
    Jair de Oliveira Junior

    Hi Bala
    You can have clock in and clock out in a weekly view.
    you have to change the data entry profile settings.
    In general settings tab in data entry profile click the with clock times button and maintain the Period type to 02 in time settings tab.
    And you can view the weekly entry in clock in and clock out.
    Ravee
    +91.99206.33669

  • How to know the process chain start time and end time

    Hi Experts,
                   How to know the process chain start time  and end time .
    Thanks in advance
    Regards
    Gutti
    Edited by: guttireddy on Feb 23, 2012 11:30 PM

    Hi Reddy,
    You may find the run time of a PC using below steps.
    1. Call SE38 > /SSA/BWT > Execute  > Enter your PC , choose the date and time > Execute. Here Run-time of a PC is displayed. (or)
    2. Call RSPC1 > Enter your PC > Execute > Goto Log view > Right click on the start Variant > Displaying Messages > Note down the start time in Chain Tab. Now Right click on the last Process type of the PC > Displaying Messages > Note down the End time in Chain Tab. The Difference b/w start time and end time gives the Run-time of your PC.
    Hope this helps.
    Regards
    Sai

  • In SharePoint Calendar lists, fields [Start Time] and [End Time] do not exist at the Site Column level.

    <header style="box-sizing:border-box;color:#777777;line-height:1;font-size:13px;padding-right:46px;margin-bottom:3px;font-family:'Helvetica Neue', arial, sans-serif;">
    </header>
    I'm doing SP app development and have the following problem.
    I need to check Start time and End Time in SharePoint Calendar using CAML query and then add a new event to Calendar list using the Start time and End Time that user has entered in 2 datapickers
    in the form.
    function AddCalendarListItems() {
    var SD = document.getElementById("datepicker1").value;
    var SThh = document.getElementById("St1").value;
    var STmm = document.getElementById("St2").value;
    var ED = document.getElementById("datepicker2").value;
    var EThh = document.getElementById("Et1").value;
    var ETmm = document.getElementById("Et2").value;
    var T = document.getElementById("Title").value;
    var S1 = SThh;
    SD = SD.slice(6, 10) + "-" + SD.slice(0, 2) + "-" + SD.slice(3, 5) + "T" + SThh + STmm + ":00Z";
    ED = ED.slice(6, 10) + "-" + ED.slice(0, 2) + "-" + ED.slice(3, 5) + "T" + EThh + ETmm + ":00Z";
    //alert("SD= " + SD + " , ED= " + ED);
    var siteUrl = SiteCollurl + "/SharePointApp11";
    var clientContext = new SP.ClientContext(siteUrl);
    var oList = clientContext.get_web().get_lists().getByTitle('Calendar');
    var ListItemCInfo = new SP.ListItemCreationInformation();
    var newEvent = oList.addItem(ListItemCInfo);
    newEvent.set_item("Title", T);
    newEvent.set_item("EventDate", SD);
    newEvent.set_item("EndDate", ED);
    newEvent.update();
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQueryAddCalendarSucceeded2), Function.createDelegate(this, this.onQueryAddCalendarFailed2));
    function onQueryAddCalendarSucceeded2(sender, args) {
    alert("Success");
    function onQueryAddCalendarFailed2(sender, args) {
    alert('Add new item to the calendar failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    But I receive the following error:
    Add new item to the Calendar failed. Column 'Start time' does not exist. It may have been deleted by another user.
    I've checked and 'Start time' does exist. So it seems in SharePoint Calendar lists, field [Start Time] and [End Time]  exist but do not exist at the Site Column level.
    Please advise.

    Hi Khojasteh,
    Use “EventDate” for Start Time field, and “EndDate” for End Time field. They are the internal name of the two fields, you can check it in the column settings page url like “Field=EndDate”.
    If it isn’t the issue, please debug the code, in which line the error occurs.
    Thanks,
    Qiao
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Qiao Wei
    TechNet Community Support

  • Hide the start time and end time in ESS portal

    Experts,
    We have a requirement to hide the Start time and End time on the header section of the travel request / expense sheet in the ESS portal.  I have searched through the configuration and found several place to hide the start time and end time of segment yet these have no impact on the porta start and end time fields.
    Please Advise.
    Best Regards,
    Martin Weakley

    Hi Martin,
    you can achieve this with administrative personalisation. In portal content navigate to the role where you deltalinked your iView, click "preview". When a new Window for the preview is opened, notice the URL contains "&sap-config-mode=true". Now right click on the fields you want to hide and choose "enter configuration" (or the like, wording is not exact) from the context menue. The WD-UI-Element tree opens where you can directly hide/customize properties of the WD. When clicking save+exist you can also transport the alterations you did.
    maybe this helps or gives you a helpful alternative to the already stated measures in this thread
    regards, Lukas

  • How to activate fields "Start Reason" and "End Reason" in "Contact" form?

    Hello all,
    We recently migrated HRMS from version 11.5.7 to *12.1.3*. In the previous version users filled the fields Start Reason and End Reason in the Contact form (PERWSDPC), section Contact Relationship.
    In our 12.1.3 version these fields are read-only and I can not figure out how to activate them.
    PS: I have populated the list of values that should be used in the above fields, using the form Life Event Reasons (Total Compensation: General Definitions: Additional Setup: Life Event Reasons) and setting the Type field value with Personal, but I don't know how activate the fields in Contact form.
    Any suggestions?
    Thanks
    Paolo Bertinetto
    Edited by: user3312880 on 7-gen-2013 2.11

    But in addition to entering values in *Life Event Reasons" form, there are other setup steps that have to be performed in order to use the two above fiields?                                                                                                                                                                                                                                                                                                                           

  • Enter start time and end time of inspection

    Dear all
    Plz tell me where we can enter start time and end time of inspection.
    Regards
    Nirmala

    Hi Nirmala,
    I think Inspection start time is not required for any analysis or else. Days taken for closing lots are important than time. Any how, the stock posted or Inspection completed time is already available in Stock posting log - transaction QA33.
    In transaction QA33,
    1. Input Material, Plant & Period etc
    2. Select a lot (UD made)
    3. Select Usage decision tab
    4. Select Stock posting tab
    5. Select Stock posting log in the tab(header) - here your inspection completed (UD) time is getting stored
    Further issue, pls reply.
    VRMP.

  • How to replace a substring that starts with and end with another substring?

    Hi,
    I am trying to parse data from HTML tables. First I want to remove all useless tags like <font>. Now, how can I remove substrings like-
    *<font face="Verdana, Arial, Helvetica, sans-serif" size="1">My_Data_to_parse</font>*
    I was searching for any method which replaces a substring what starts with a substring (in this case "<font") and ends with another substring (in this case ">") . Is there any method like that? Or any better solution?
    Another situation like the following-
    *<td align="left" height="30" width="100%">*
    In this case I want to remove all the height, align , width etc and make it as simple as "<td>". How can I do that?
    Finally, all I am trying to do just to parse data from the tables in a html file. Is there any parser API or library to help me do that? Or to bring the data down to array from the tables based on table structure? Please suggest me.
    Thanks in advance.

    probably the best place to start is to search for the "<keyword" of all of the html keywords, then search for the location of the next ">" - this will indicate the end of the <keyword> opening tag.

  • Title in motion starts fast and ends slow... need to make it consistent across the motion. Deadline is very soon! help!

    I made a title, and used the motion tool (position and scale) in effect controls to move it across the screen, while making it bigger. When I see the motion at hand, it starts very fast and ends very slowly... how do I edit the speed of that motion? working with Mac BTW. HELP

    Control it with Key Frames.
    If you have applied  no KFs it should be linear (constant) already.

  • Function Module for Start time and End time

    Hi Experts,
    I need a function module for getting particular Work schedule rule start time and endtime and further details by passing personnel number and day.
    Thanks in advance.
    Sunil

    FYI - https://forums.sdn.sap.com/click.jspa?searchID=-1&messageID=5338428
    Thanks,
    SK

  • Lookup DSO in Start Routine and End Routine to update date

    Hi Gurus,
    I need a Start Routine & help, while loading the data from DSO to Info Cube.
    In the DSO ( /BIC/AZSD_O0300 ) & in the InfoCube I have a common fields are
    0DOC_NUMBER ( DOCUMENT NUMBER), 0S_ORD_ITEM ( Sales Document Item Number ), 0SCHED_LINE ( Schedule Line ) and 0MATAV_DATE ( Material Available Date ).
    Data in DSO is as follows
    0DOCNUMBER_ 0SORD_ITEM_ 0SCHEDLINE_ 0MATAVDATE_
    1001 10 1 05/21/2011
    1001 20 2 05/26/2011
    1001 10 2 05/22/2011
    1001 20 1 05/18/2011
    1002 20 1 05/20/2011
    1002 10 1 05/24/2011
    1002 10 2 05/28/2011
    Data should load in the InfoCube as below.
    0DOCNUMBER    0S_ORD_ITEM     0SCHED_LINE    0MATAV_DATE
    1001          10    1   05/21/2011
    1001          20    2   05/18/2011
    1001          10    2   05/21/2011
    1001          20     1  05/18/2011
    1002         20     1  05/20/2011
    1002         10    1   05/24/2011
    1002         10     2   05/24/2011  
    When ever schedule line is 2 for the record we have to check both Document number and 0S_ORD_ITEM are same change the Material moving date to the date schedule line is 1 for the same document and same order item number.
    Your help is really appreciated.
    Thanks
    Ganesh Reddy.

    Thanks Parth and Raj. I have written code almost as you suggested just little changes.
    Start Routine
    TABLES:/BIC/AZSD_O0300.
    DATA:ITAB_DSO LIKE /BIC/AZSD_O0300.
    TYPES: BEGIN OF ITABTYPE,
    DOC_NUM TYPE /BI0/OIDOC_NUMBER,
    SAL_DOC_NUM TYPE /BI0/OIS_ORD_ITEM,
    SCHED_NUM TYPE /BI0/OISCHED_LINE,
    MAT_AV_DATE TYPE /BI0/OIMATAV_DATE,
    END OF ITABTYPE.
    DATA : ITAB TYPE STANDARD TABLE OF ITABTYPE
           WITH HEADER LINE
           WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    data: wa_itab type ITABTYPE.
    SELECT DOC_NUMBER S_ORD_ITEM SCHED_LINE MATAV_DATE
      FROM /BIC/AZSD_O0300
      INTO TABLE ITAB
      WHERE SCHED_LINE = '1'.
    Field Routine.
    if SOURCE_FIELDS-S_ORD_ITEM <> '1'.
          read table itab into wa_itab with key    doc_num =
          SOURCE_FIELDS-DOC_NUMBER
                                             SAL_DOC_NUM =
                                             SOURCE_FIELDS-S_ORD_ITEM.
          if sy-subrc = 0.
          RESULT = wa_itab-MAT_AV_DATE.
        endif.
      endif.
    I haven't check how the data is coming. But for now I am closing this issue.
    Thanks Again
    Ganesh Reddy.

  • 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 ******/

  • How to edit two starttime & end time into single start time and end time

    my application is to reserve a resource for particular period of time
    (min 1hr) so i store time into database as numerice value
    i need to edit the reserved time
    my problem is
    (for eg)
    a user reserve as 6.00 to 9.00
    the same user reserve as 15.00 to 18.00 on the same day
    if the user need to edit the time as 8.00 to 16.00 then i need to check the database and update it to 8.00 to 16.00 and those two reservation should not be present in the database
    i dont know how to solve this problem
    kindly help me in this regard
    thank u in advance

    How are you storing the two times?
    If u r storing as two different records u need to delete them and add a new one
    Other approach is to store the time as comma separated values like
    6.00-9.00, 15.00-18.00. when u want to change them just update it with the latest value.

  • How to change Validity Start and end dates on a lane ?

    Hi,
    I am trying to change Validity start and end dates on a lane for a product specific assignment.
    What I see is as follows
    1) Lane created by system /others I can delete and give the required start /end date ?
    I want to know if I can change the end date without deleting the lane as its tough to delete a lane in production.
    Thanks
    -Venky.

    Hi,
    we can change the start period and end period in the Transportation lane using the table /SAPAPO/TRPROD.
    And then using the update command you can change the start time and end time of the product.
    Regards,
    Hyma.

Maybe you are looking for

  • Windows 7 - Apple Application Support was not found.  Error Message

    Hello Folks, i keep getting the following message, despite the fact that i have uninstalled Itunes and then installed it again a few times. "Apple Application Support was not found.  Please uninstall, and install again.  Error 2 (Windows Error 2). Ca

  • How to make an entry in transport tab of business system in SLD

    Hi gurus, In PI, in SLD we maintain Business systems. In this business sytem if we go to have a detail look there is a Transport tab. What is this used for and how to make an entry here. I'm a basis person and i'm configuring XI for the first time. K

  • Cannot attach files to Mac Mail

    Hello, I have a new Mac mini running 10.8.4.  I am transitioning from a Windows PC.  I have setup Mac Mail v 6.5 (1508) against Gmail for both my wife and I on separate Mac user accounts.  Both of us see the same behavior from both of our accounts. 

  • Mechanism of a insert into select

    Hi I am using a insert with select in a batch program which is supposed to run just a little before midnight. My question is, when a insert into a table occurs, does oracle select all the rows before the insert starts, OR, does the insert occur simul

  • ECATT to QTP AND QTP to eCATT connectivity

    We are trying to open QTP scripts from eCATT & vice-versa. As per documentation provided by SAP & Mercury all the steps have ben followed but it gives following errors: 1. If QTP script is to be opened from eCATT while creating script using External