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
Solved

how to avoid & being &

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

837 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