Click here to Skip to main content
15,881,757 members
Articles / Database Development / SQL Server
Tip/Trick

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

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
5 Jan 2011CPOL 30K   2   2
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)


Written By
Software Developer (Senior) Shams Software Services
Pakistan Pakistan
I have been working as a Senior Software Analyst in Shams Software Services and during this I have been working in Sql Server and C# .Net

Comments and Discussions

 
GeneralReason for my vote of 5 I searched alot for this error and t... Pin
FSUMSoft11-Jan-11 22:41
FSUMSoft11-Jan-11 22:41 
GeneralReason for my vote of 5 It resolved my problem and saved my ... Pin
Abdul_Hafeez6-Jan-11 0:25
Abdul_Hafeez6-Jan-11 0:25 
Reason for my vote of 5
It resolved my problem and saved my time

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.