Microsoft KB Archive/198105

= BUG: Errors When Creating a View Using the WITH CHECK OPTION in SQL Enterprise Manager =

Article ID: 198105

Article Last Modified on 10/15/2002

-

APPLIES TO


 * Microsoft SQL Server 7.0 Standard Edition

-



This article was previously published under Q198105



BUG #: 50705 (SQLBUG_70)



SYMPTOMS
When you create or edit a view with the WITH CHECK OPTION from SQL Server Enterprise Manager, you may receive any of the following error situations and messages:

 When you try to save or run the view you created, you receive the following error message:

unable to parse query text

 If you respond to the dialog box which displayed the previous error, you may receive the following error message:

[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1 :

Incorrect syntax near 'WITH'.

 If you choose Verify SQL, you receive the following error message:

Query Designer encountered a MS Design error :

ODBC error : [Microsoft][ODBC SQL Server Driver][SQL Server]

Line 1 : Incorrect syntax near 'WITH'.

[Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s)

could not be prepared.

 If you attempt to design a view which was originally created using the WITH CHECK OPTION, the WITH CHECK OPTION clause is not displayed in Enterprise Manager, but is indeed enabled for the view. If you check the view properties (right-click the view and click Properties), you can verify that the WITH CHECK OPTION is enabled.



WORKAROUND
To create or save the view, do either of the following:


 * Use the Query Analyzer to create a view with the CREATE VIEW statement, if you want to include the WITH CHECK OPTION clause. -or-


 * When you save the view in SQL Enterprise Manager, the view is actually created and saved, even though you receive the error message.

To run the view, do either of the following:

 Go to the Query Analyzer and run the view from there. For example, if you need to have all the columns in the View1 view returned, run the following query:

Select * from View1

-or-

</li> After you save the view, close the Design View window in SQL Enterprise. You can run the view by right-clicking it and then clicking the Open View option.</li></ul>

<div class="status_section">

STATUS
Microsoft has confirmed this to be a problem in SQL Server version 7.0.

Additional query words: prodsql Enterprise Manager SEM EM MMC

Keywords: kbbug kbpending KB198105

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.