BUG: Table Designer Error with Single Quote in a Table Name (197797)



The information in this article applies to:

  • Microsoft SQL Server 7.0

This article was previously published under Q197797
BUG #: 41946 (SQLBUG_70)

SYMPTOMS

When you try to open a table in the Enterprise Manager Table Designer and the table name includes a single quotation mark character, you will receive the following error message:
An unexpected error happened during this operation.
[MS Design Tools]-ODBC error: [Microsoft][ODBC][ODBC SQL Server
Driver][SQL Server] Line1:Incorrect Syntax near '<string>'
[Microsoft][ODBC][ODBC SQL Server Driver][SQL Server]Unclosed quotation
mark before the character string ')'

WORKAROUND

To work around this problem, do one of the following:
  • Make changes to the table in SQL Server Query Analyzer, by using the ALTER TABLE statement.

    -or-
  • In Query Analyzer, use the sp_rename stored procedure to rename the table so that it does not contain a single quotation mark, as in the following example:
          sp_rename [table'1], [table_1]
    
    						
    After the table is renamed, you will be able to use the Design Table features in Enterprise Manager to design the table. For example:

STATUS

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

Modification Type:MinorLast Reviewed:3/14/2005
Keywords:kbBug KB197797