Home Forums Programming XML Need converting a table to XML RE: Need converting a table to XML

  • Here is some data - modified to protect the innocent.

    INSERT [dbo].[MyTable] ([Candidate First Name], [Candidate Middle Name], [Candidate Last Name], [Candidate Name Prefix],

    [Candidate Name Suffix], [Candidate Email], [Candidate Address Line 1], [Candidate Address Line 2],

    [Candidate City], [Candidate State/Province/Region], [Candidate Postal Code], [Candidate Country],

    [Candidate Primary Phone], [Candidate Secondary Phone], [Primary Contact Method], [Enter Date], [Original Source],

    [Desired Career Level], [Professional Certifications], [Candidate's Work Authorization], [Collegiate Majors],

    [Current Job Type], [Date Available], [Degree Level], [Desired Job Type], [Candidate's Disposition], [Password],

    [Willing to Relocate?], [Relocation Preferences], [Resume Body], [Salary Requirement], [Security Clearance?], [Skill Set],

    [Contact Notes], [Comment], [Additional Countries], [Years of Experience], [Veteran Status], [Ethnicity Code],

    [Gender], [Disabled Status], [Job ID], [Stage Seq No], [Contact Info Custom Field 1 - 10], [Resume Custom Field 1- 10])

    VALUES(N'William', NULL, N'Johnson', NULL, NULL, N'', N'125 Lamplight Lane', NULL,

    N'MyTown', N'NY', N'12121', N'USA', N'', NULL, NULL, CAST(0x00009F8100000000 AS DateTime),

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)

    INSERT [dbo].[MyTable] ([Candidate First Name], [Candidate Middle Name], [Candidate Last Name], [Candidate Name Prefix],

    [Candidate Name Suffix], [Candidate Email], [Candidate Address Line 1], [Candidate Address Line 2],

    [Candidate City], [Candidate State/Province/Region], [Candidate Postal Code], [Candidate Country],

    [Candidate Primary Phone], [Candidate Secondary Phone], [Primary Contact Method], [Enter Date], [Original Source],

    [Desired Career Level], [Professional Certifications], [Candidate's Work Authorization], [Collegiate Majors],

    [Current Job Type], [Date Available], [Degree Level], [Desired Job Type], [Candidate's Disposition], [Password],

    [Willing to Relocate?], [Relocation Preferences], [Resume Body], [Salary Requirement], [Security Clearance?], [Skill Set],

    [Contact Notes], [Comment], [Additional Countries], [Years of Experience], [Veteran Status], [Ethnicity Code],

    [Gender], [Disabled Status], [Job ID], [Stage Seq No], [Contact Info Custom Field 1 - 10], [Resume Custom Field 1- 10])

    VALUES(N'John', NULL, N'Johnson', NULL, NULL, N'', N'2125 Flat Turnpike', NULL,

    N'MyTown', N'NY', N'12121', N'USA', N'', NULL, NULL, CAST(0x00009F8100000000 AS DateTime),

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)

    INSERT [dbo].[MyTable] ([Candidate First Name], [Candidate Middle Name], [Candidate Last Name], [Candidate Name Prefix],

    [Candidate Name Suffix], [Candidate Email], [Candidate Address Line 1], [Candidate Address Line 2],

    [Candidate City], [Candidate State/Province/Region], [Candidate Postal Code], [Candidate Country],

    [Candidate Primary Phone], [Candidate Secondary Phone], [Primary Contact Method], [Enter Date], [Original Source],

    [Desired Career Level], [Professional Certifications], [Candidate's Work Authorization], [Collegiate Majors],

    [Current Job Type], [Date Available], [Degree Level], [Desired Job Type], [Candidate's Disposition], [Password],

    [Willing to Relocate?], [Relocation Preferences], [Resume Body], [Salary Requirement], [Security Clearance?], [Skill Set],

    [Contact Notes], [Comment], [Additional Countries], [Years of Experience], [Veteran Status], [Ethnicity Code],

    [Gender], [Disabled Status], [Job ID], [Stage Seq No], [Contact Info Custom Field 1 - 10], [Resume Custom Field 1- 10])

    VALUES(N'Raymond', NULL, N'Fox', NULL, NULL, N'', N'111 Wall Street', NULL,

    N'MyTown', N'NY', N'12121', N'USA', N'', NULL, NULL, CAST(0x00009F8100000000 AS DateTime),

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)

    INSERT [dbo].[MyTable] ([Candidate First Name], [Candidate Middle Name], [Candidate Last Name], [Candidate Name Prefix],

    [Candidate Name Suffix], [Candidate Email], [Candidate Address Line 1], [Candidate Address Line 2],

    [Candidate City], [Candidate State/Province/Region], [Candidate Postal Code], [Candidate Country],

    [Candidate Primary Phone], [Candidate Secondary Phone], [Primary Contact Method], [Enter Date], [Original Source],

    [Desired Career Level], [Professional Certifications], [Candidate's Work Authorization], [Collegiate Majors],

    [Current Job Type], [Date Available], [Degree Level], [Desired Job Type], [Candidate's Disposition], [Password],

    [Willing to Relocate?], [Relocation Preferences], [Resume Body], [Salary Requirement], [Security Clearance?], [Skill Set],

    [Contact Notes], [Comment], [Additional Countries], [Years of Experience], [Veteran Status], [Ethnicity Code],

    [Gender], [Disabled Status], [Job ID], [Stage Seq No], [Contact Info Custom Field 1 - 10], [Resume Custom Field 1- 10])

    VALUES(N'Matthew', NULL, N'Foley', NULL, NULL, N'', N'884 First Ave', NULL,

    N'MyTown', N'NY', N'12121', N'USA', N'', NULL, NULL, CAST(0x00009F8100000000 AS DateTime),

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)

    INSERT [dbo].[MyTable] ([Candidate First Name], [Candidate Middle Name], [Candidate Last Name], [Candidate Name Prefix],

    [Candidate Name Suffix], [Candidate Email], [Candidate Address Line 1], [Candidate Address Line 2],

    [Candidate City], [Candidate State/Province/Region], [Candidate Postal Code], [Candidate Country],

    [Candidate Primary Phone], [Candidate Secondary Phone], [Primary Contact Method], [Enter Date], [Original Source],

    [Desired Career Level], [Professional Certifications], [Candidate's Work Authorization], [Collegiate Majors],

    [Current Job Type], [Date Available], [Degree Level], [Desired Job Type], [Candidate's Disposition], [Password],

    [Willing to Relocate?], [Relocation Preferences], [Resume Body], [Salary Requirement], [Security Clearance?], [Skill Set],

    [Contact Notes], [Comment], [Additional Countries], [Years of Experience], [Veteran Status], [Ethnicity Code],

    [Gender], [Disabled Status], [Job ID], [Stage Seq No], [Contact Info Custom Field 1 - 10], [Resume Custom Field 1- 10])

    VALUES(N'Robert', NULL, N'Jackson', NULL, NULL, N'', N'123 Main St', NULL,

    N'MyTown', N'NY', N'12121', N'USA', N'', NULL, NULL, CAST(0x00009F8100000000 AS DateTime),

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)

    INSERT [dbo].[MyTable] ([Candidate First Name], [Candidate Middle Name], [Candidate Last Name], [Candidate Name Prefix],

    [Candidate Name Suffix], [Candidate Email], [Candidate Address Line 1], [Candidate Address Line 2],

    [Candidate City], [Candidate State/Province/Region], [Candidate Postal Code], [Candidate Country],

    [Candidate Primary Phone], [Candidate Secondary Phone], [Primary Contact Method], [Enter Date], [Original Source],

    [Desired Career Level], [Professional Certifications], [Candidate's Work Authorization], [Collegiate Majors],

    [Current Job Type], [Date Available], [Degree Level], [Desired Job Type], [Candidate's Disposition], [Password],

    [Willing to Relocate?], [Relocation Preferences], [Resume Body], [Salary Requirement], [Security Clearance?], [Skill Set],

    [Contact Notes], [Comment], [Additional Countries], [Years of Experience], [Veteran Status], [Ethnicity Code],

    [Gender], [Disabled Status], [Job ID], [Stage Seq No], [Contact Info Custom Field 1 - 10], [Resume Custom Field 1- 10])

    VALUES(N'Thomas', NULL, N'Cody', NULL, NULL, N'', N'38 Glenn Aveue', NULL,

    N'MyTown', N'NY', N'12121', N'USA', N'', NULL, NULL, CAST(0x00009F8100000000 AS DateTime),

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)

    INSERT [dbo].[MyTable] ([Candidate First Name], [Candidate Middle Name], [Candidate Last Name], [Candidate Name Prefix],

    [Candidate Name Suffix], [Candidate Email], [Candidate Address Line 1], [Candidate Address Line 2],

    [Candidate City], [Candidate State/Province/Region], [Candidate Postal Code], [Candidate Country],

    [Candidate Primary Phone], [Candidate Secondary Phone], [Primary Contact Method], [Enter Date], [Original Source],

    [Desired Career Level], [Professional Certifications], [Candidate's Work Authorization], [Collegiate Majors],

    [Current Job Type], [Date Available], [Degree Level], [Desired Job Type], [Candidate's Disposition], [Password],

    [Willing to Relocate?], [Relocation Preferences], [Resume Body], [Salary Requirement], [Security Clearance?], [Skill Set],

    [Contact Notes], [Comment], [Additional Countries], [Years of Experience], [Veteran Status], [Ethnicity Code],

    [Gender], [Disabled Status], [Job ID], [Stage Seq No], [Contact Info Custom Field 1 - 10], [Resume Custom Field 1- 10])

    VALUES(N'David', NULL, N'Bell', NULL, NULL, N'', N'57 Long Rd. Apt. 2', NULL,

    N'MyTown', N'NY', N'12121', N'USA', N'', NULL, NULL, CAST(0x00009F8100000000 AS DateTime),

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)