Solved

how to avoid & being &

Posted on 2011-02-21
2
389 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

Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

Question has a verified solution.

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

Suggested Solutions

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

730 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