Categories
Welcome Center
Education & Development
Discussions
Certification Preparation
Recent Posts
Groups
Free Resources
Ebooks
Free Workshops
Trending Certifications Infographic
Infosec Training
IT & Security Training
Live Boot Camps
Security Awareness Training
About Infosec Institute
Home
Certification Preparation
Microsoft
SQL 2012 - XML Question
garywin7
Hi
I may be remembering this wrong but
is there a way of outputting :-
<Name>Fred/Bloggs<Name>
so combining 2 columns into one element ?
if this is nonsense then just let me know , no need to swear though . . .
Find more posts tagged with
Save $250 on 2025 certification boot camps from Infosec!
Book now with code EOY2025
Button
Comments
NotHackingYou
If the columns are non XML columns then you can use simple concatenation. SELECT '<name>' + firstName + '/' + lastName + '</name>' FROM usersTable WHERE (conditions). This will output in the format you want. There are other ways to do this but this is quick.
If you are trying to extract from an XML column then it is a little tricker.
garywin7
Hi
I'm thinking of non-xml columns so I know you can use FOR XML AUTO etc.
and its that type of answer i'm really looking for
good idea on the select string approach though
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Best Of
INFOSEC Boot Camps
$250
OFF
Use code
EOY2025
to receive $250 off your 2025 certification boot camp!
BROWSE BOOT CAMPS