DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Replace Function In SQL 2005

01.29.2007
| 243 views |
  • submit to reddit
        // description of your code here

SELECT 
     DISTINCT CALL_NUMBER, 

        Actie = 
		Replace (
		REPLACE( 
        ( 
            SELECT 
                ACTIONS_DESC AS [data()] 
            FROM 
                 dbo.CL_PROBLEM_HISTORY clh 
            WHERE 
                clh.CALL_NUMBER = c.CALL_NUMBER 
            ORDER BY 
                CALL_NUMBER, HISTORY_ORDER
            FOR XML PATH ('') 
        ), ' ', ' ') 
		
		, '
', ' ')
FROM 
    dbo.CL_PROBLEM_HISTORY c
ORDER BY 
    CALL_NUMBER