PRB: "Incorrect Syntax Near" Error When You Run the DBCC CHECKCONSTRAINTS Statement (814577)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

BUG #: 363951 (SHILOH_Bugs)

SYMPTOMS

When you run the DBCC CHECKCONSTRAINTS statement in SQL Query Analyzer, you may receive the following error message:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near ')'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

CAUSE

The error occurs because the value of the CONCAT_NULL_YIELDS_NULL database option is set to OFF.

RESOLUTION

To resolve the problem, set the value of the CONCAT_NULL_YIELDS_NULL database option to ON before you run the DBCC CHECKCONSTRAINTS statement.

To set this value, perform one of the following procedures:
  • Run the following code in SQL Query Analyzer:
    SET CONCAT_NULL_YIELDS_NULL  ON
-Or-
  • In SQL Query Analyzer:
    1. On the Query menu, click Current Connection Properties.
    2. Click to select the Set concat_null_yields_null SET option.
    3. Click OK.

STATUS

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

MORE INFORMATION

The default value of the CONCAT_NULL_YIELDS_NULL database option is ON in SQL Query Analyzer.

For more information, visit the following Microsoft Developer Network (MSDN) Web site links:

REFERENCES

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

279338 FIX: DBCC CHECKCONSTRAINTS Does Not Handle Names with Special Characters


Modification Type:MajorLast Reviewed:10/3/2003
Keywords:kberrmsg kbprb KB814577 kbAudDeveloper