Solved

Create a table with XML column

Posted on 2013-01-29
3
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 143

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how the fundamental information of how to create a table.

617 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