• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

Create a table with XML column

Hi Experts,
I am trying to create a simple table with 2 columns as below.  Is there a simple way to create the table and insert data to it?  Specially to Resume column being XML data type, I had hard time understanding it?  Thank you in advance.

Column   Data Type
-----------   --------------
Id             Integer
Resume   XML
0
RadhaKrishnaKiJaya
Asked:
RadhaKrishnaKiJaya
1 Solution
 
deviprasadgCommented:
CREATE TABLE RESUMES(
ID INT,
Resume   XML)

GO

INSERT INTO RESUMES
SELECT 1,'<RESUME><NAME>NAME</NAME><ADDRESS>ADDRESS DETAILS</ADDRESS></RESUME>'

--OR

INSERT INTO RESUMES
SELECT 2,CAST('<RESUME><NAME>NAME2</NAME><ADDRESS>ADDRESS2 DETAILS</ADDRESS></RESUME>' AS XML)

GO

SELECT * fROM RESUMES

GO

Open in new window

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Can you Please clarify what issue you run into?
The xml data type is nothing else than VARCHAR + some integrity checks + some xml functions you can apply on the columns...
0
 
RadhaKrishnaKiJayaAuthor Commented:
Thank you.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now