?
Solved

how to avoid & being &

Posted on 2011-02-21
2
Medium Priority
?
392 Views
Last Modified: 2012-05-11
Hello experts,

Can someone tell me how to avoid '&' displaying as &

In the attached code, the column SubCategoryName has a name containing '&' and result is displayed as '&'

I assume it's because of the use of FOR XML PATH(' ').

All the help would be greatly appreciated on how to avoid that.  
SELECT cast(CSC.CategoryName as nvarchar(100)) AS Categories, AppendSubCategories.SubCategoryNames AS SubCategories 
		FROM dbo.CaseStudyCategories CSC 
		CROSS APPLY (SELECT SubCategoryName + '|'  
             FROM dbo.CaseStudySubCategories CSSC
             WHERE CSC.CategoryID = CSSC.CategoryID
             ORDER BY SubCategoryName
             FOR XML PATH(''))AppendSubCategories(SubCategoryNames)
             ORDER BY Categories

Open in new window

0
Comment
Question by:KoolAsIce
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 

Accepted Solution

by:
KoolAsIce earned 0 total points
ID: 34947786
0
 

Author Closing Comment

by:KoolAsIce
ID: 34947788
Yes I found solution somewhere else and the link is posted.
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question