BUG: Entity Defaults Are Ignored When Clarification Question Is Asked (286290)



The information in this article applies to:

  • Microsoft SQL Server 7.0
  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q286290
BUG #: 101229 (SQLBUG_70)
BUG #: 352001 (SHILOH)

SYMPTOMS

A question that requires English Query to request clarification may cause entity defaults to be ignored.

WORKAROUND

If results need to be restricted, create SQL Server views that contain the data that you want to show. Then create entities based on the views.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Examples of Clarification Questions

English Query needs clarification when it is asked an ambiguous question. For example, suppose you have two entities:
  • A Customer.

    and

  • An Employee.
Both of the entities have FirstName and LastName attributes. The Employee entity has an addtional Contract attribute. The entities are based on the following SQL Server table definitions:
CUSTOMER(ID int primary key, 
         FirstName varchar(20),
         LastName varchar(20))

EMPLOYEE(ID int primary key, 
         FirstName varchar(20),
         LastName varchar(20),
         Contract bit))
If a user asks the question "What can you tell me about John Williams?" English Query needs to ask a clarification question because it cannot automatically determine the entity to which the question refers. In the example, John Williams could either be a Customer or Employee and there are two possible queries to the SQL Server server:
SELECT FirstName, LastName FROM Customer<BR/>
SELECT FirstName, LastName FROM Employee<BR/>
Therefore, the question is ambiguous. The user (or client application) must clarify whether the question refers to an Employee or a Customer in order to obtain a result.

Enity Defaults

Entity defaults are used when results need to be restricted. Using the preceding example, suppose you add an entity default to Employees that restricts results to employees with a contract. So the statement "List the employees" only returns employees having Contract = 1.

The problem arises when you again ask the question "What can you tell me about John Williams?" Suppose Contract = 0 for John Williams. English Query first asks a clarification question because the question is ambiguous. Suppose the user (or client application) clarifies by stating that John Williams is an Employee. Because the Employee entity has a default Contract = 1, no results should be returned for this question. This is not what happens because the information about John Williams is returned. The default condition is ignored because a clarification question was asked.

To work around this issue, you can create a SQL Server view that contains only those employees with Contract = 1. Then you create another entity by using the English Query designer based on that view. This provides an alternate to using Entity defaults.

Modification Type:MajorLast Reviewed:10/17/2003
Keywords:kbBug kbpending KB286290