clear markdown feedback
clear markdown feedback
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 3364508 fiddles created (36306 in the last week).

DECLARE @xml xml = N' <PersonID>1</PersonID> <MarketingPreference>Allow</MarketingPreference> <AllowPhone>No</AllowPhone> <AllowEmail>Yes</AllowEmail> <AllowTxt>Yes</AllowTxt> <AllowMob>Yes</AllowMob>'; SELECT PersonID = x.p.value('(PersonID)[1]', 'int'), MarkPref = x.p.value('(MarketingPreference)[1]', 'varchar(20)'), AllowPhone = x.p.value('(AllowPhone)[1]','varchar(20)'), AllowEmail = x.p.value('(AllowEmail)[1]','varchar(20)'), AllowTxt = x.p.value('(AllowTxt)[1]', 'varchar(20)'), AllowMob = x.p.value('(AllowMob)[1]', 'varchar(20)') FROM @xml.nodes('.') AS x(p);
PersonID MarkPref AllowPhone AllowEmail AllowTxt AllowMob
1 Allow No Yes Yes Yes
 hidden batch(es)