Solved

how to avoid & being &

Posted on 2011-02-21
2
390 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 learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

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…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
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…
Viewers will learn how the fundamental information of how to create a table.

729 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