Enforce Join

Posted on 2011-05-09
Last Modified: 2012-05-11
I want to know the difference between the different types of enforce join:

-Not enforced
-Enforced From
-Enforced To
-Enforced Both

Question by:MKItani
    LVL 57

    Accepted Solution


    Author Comment

    i read these article before but it is not clear at all,
    So please any body can send me a real example or an explanation more effective.
    LVL 8

    Assisted Solution

    For details & Example of Types of Joins in SQL server Go to
    LVL 3

    Assisted Solution

    Enforcing joins are used in SQL server to optimize the query, below link will help you to identify
    LVL 57

    Assisted Solution

    by:Raja Jegan R
    >> i have choiced the false category.

    Instead of deleting this question, you can request Moderators to add this question into Crystal Reports zone.
    Now that I have objected, Moderators can add this question to appropriate zones.

    Author Comment

    Please remove this question form ms SQL SERVER CATEGORY to Crystal report category
    LVL 100

    Assisted Solution

    LVL 100

    Assisted Solution

    A real example

    Consider an Order system

    Order Table
    OrderId                CustomerId                   OrderDate                  ShipDate
       1                            1                               1 May 2011               4May 2011
       2                            3                               3 May 2011               6 May 2011
       3                            4                               8 May 2011
       4                            5                               11 May 2011

    Order Detail Table
    OrderDetailId      fkOrderId        ProductId     Quantity        
         1                           1                   P1                2
          2                           1                  P2                 1
         3                            2                  P1                 10
         4                            2                  P4                 1
          5                           3                  P2                 1
         6                            5                  P5                 2

    Customer Table
    CustomerId   Name            Address            City      
         1                J Smith          11 Some St      SunCity
         2                B Jones         12 Another Ave   NewCity
         3                K Doe             15  A St             SomeCity
         5                J Doe              20 A St              Some City

      Select Order.* FROM Order INNER JOIN OrderDetail ON Order.OrderId = OrderDetail.fkOrderId

    Not Enforced - 4 records are returned   - No fields from Order Detail selected so it is ignored.  Same as
    Select Order.* FROM Order

    Enforced       - 3 records are returned   OrderIds 1,2,3  OrderId 4 is not returned because there is no matching record in the detail table.

    Enforced From - 4 records returned.  Ignored since no fields from OrderDetail selected

    Enforced To - 3 records returned same as Enforced

    Another example
    Select OrderDetail.* FROM Order INNER JOIN OrderDetail ON Order.OrderId = OrderDetail.fkOrderId

    Not Enforced - 6 records returned.  Same as Select OrderDetail.* FROM OrderDetail

    Enforced   - 5 records returned.   OrderDetail 1 - 5  All have match in Order table

    Enforced From - Same as Enforced

    Enforced To - Same as not enforced



    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video discusses moving either the default database or any database to a new volume.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now