top of page
Search
Writer's pictureCOACH Rames

Technical : Query COACH HR data with correct formatting

Use the appropriate query statement to get the correct data formatting.

SELECT

STUFF(

( SELECT ',' + 'USA <USA@foo.com>'

FOR XML PATH('')

), 1, 1, '') AS [STUFF]

,

STUFF(

( SELECT ',' + 'USA <USA@foo.com>'

FOR XML PATH(''), TYPE

).value('.[1]', 'NVARCHAR(MAX)'), 1, 1, '') AS [FORMATSTUFF]

,

SUBSTRING(

( SELECT ',' + 'USA <USA@foo.com>'

FOR XML PATH('')

), 2, 9999) AS [SUBSTRING]

,

SUBSTRING(

( SELECT ',' + 'USA <USA@foo.com>'

FOR XML PATH(''), TYPE

).value('.[1]', 'NVARCHAR(MAX)'), 2, 9999) AS [FORMATSUBSTRING]

34 views0 comments

Commenti


bottom of page