Solved

how to avoid & being &

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
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, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now