Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / database / SQL-Server

Column name Create Date contains an invalid XML identifier as required by FOR XML; ' '(0x0020) is the first character at fault.

5.00/5 (2 votes)
5 Jan 2011CPOL 31K  
To resolve the invalid chracter from FOR XML PATH clause
Background

I have a stored procedure which returns data as an XML node. This stored procedure uses temp table to populate data. The column names in the temp table contain spaces, i.e. [Create Date].

Error
"Column name Create Date contains an invalid XML identifier as required by FOR XML; ' '(0x0020) is the first character at fault."


Resolution

After removing spaces from the column names, this error was resolved.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)