A query is not successful if it has a column that contains one or more space characters (825392)



The information in this article applies to:

  • Microsoft SQL Server 2000 Windows CE Edition 2.0
  • Microsoft SQL Server 2000 Windows CE Edition

SYMPTOMS

When you run a query on a Microsoft SQL Server 2000 Windows CE Edition version 2.0 database, and the query has a column that contains one or more space characters, the query may not be successful. Additionally, you may receive the following error message:
FAILED: select <Column Name> from <Table Name>
Error: 0x80040e14 DB_E_ERRORSINCOMMAND
Native Error: (25503)
Description: The column name is not valid. [,,,Node name (if any),Column name,]
Interface defining error: IID_ICommand
Param. 0: 0
Param. 1: 0
Param. 2: 0
Param. 3:
Param. 4: col1
Param. 5:


Note For SQL Server 2000 CE databases that are earlier than version 2.0, the query may not be successful, and you may not receive an error message.

RESOLUTION

To resolve this problem, enclose the column name that contains spaces in quotation marks (" "), and then run the query. For example, you can run the following query, and the query results are displayed successfully:
SELECT "col1 " FROM testtable

MORE INFORMATION

Steps to Reproduce the Problem

To reproduce the problem, follow these steps:
  1. Open SQLCE Query.
  2. In SQL Server CE Query Analyzer, select your database or create a new test database.
  3. Create a table that is named testtable. To do so, click the SQL tab in SQL Server CE Query Analyzer, and then run the following query:
    CREATE TABLE testtable ("col1 " int)
  4. Insert a record in the testtable table. To do so, run the following query:
    INSERT INTO testtable VALUES (1)
  5. Select the inserted record from the testtable table. To do so, run the following query:
    SELECT col1  FROM testtable
    Note You may receive the error message that is mentioned in the "Symptoms" section of this article.

Modification Type:MinorLast Reviewed:9/20/2005
Keywords:kberrmsg kbTSQL kbtable kbQuery kbDatabase kbBug KB825392 kbAudDeveloper