Solved

Create a table with XML column

Posted on 2013-01-29
3
232 Views
Last Modified: 2013-04-11
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
Comment
Question by:RadhaKrishnaKiJaya
3 Comments
 
LVL 10

Accepted Solution

by:
deviprasadg earned 500 total points
ID: 38833993
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
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 38834094
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
 

Author Closing Comment

by:RadhaKrishnaKiJaya
ID: 39070719
Thank you.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question