SqlShare.com Logo
 
Skip Navigation Links
Home
Video List
Events
Classes
About Us
Login / Register
Subscribe RSS Feed 

Takes Query Plan Analysis and Performance Monitoring to a New Level

Converting a Text Data Type to an XML Data Type

Many of us have stored XML in text columns for years to get around the size limits of the varchar data type. The XML data type was introduced in SQL 2005 to give us a better and richer alternative, but what's involved in converting our existing data to the XML data type? Join XML super user Kendal Van Dyke for a quick review of the issues involved.

Duration:
1 mins 10 secs
Skill Level:
100
Rating:
4.02 out of 5
Publish Date:
October 13, 2008
Converting a Text Data Type to an XML Data Type You must be logged in to view this video.  
Bookmark and Share
 
1=Poor, 3=Good, 5=Excellent

About the Author

Image of Kendal Van Dyke
Kendal Van Dyke is a Senior DBA with Channel Intelligence in Celebration, Florida. He uses XML extensively in the database at work and believes that the improvements to XML handling in SQL 2005 substantially change how and why we handle XML.

References



Comments
Gummi on 11/25/2008
rock

Presentation cutoff prematurely.

Jimmy May on 3/13/2009
Nice job--short, sweet, very helpful.

John Breidenbach on 3/13/2009
Good... Need more XML beginer videos

Mark on 3/13/2009
Did not open

Joe Pool on 6/19/2009
Would have been nice to see what XML in the table does and how it is usedd.

Mike Salo on 6/19/2009
Pretty simple, but it was well done.

Sara Karasik on 6/19/2009
too short. I'd like alot more about this new datatype, and how it can be used, and parsed

borjonx on 6/19/2009
the guy is a very good, clear speaker. not to fast or slow.

Prasanna Prabhu on 6/20/2009
If the table is big (too many rows) is there any easy way to get a list of all ROW(s), that fails ALTER COLUMN TO XML type. If YES, can you please let us know the command. This will help us identify the BAD rows, fix the data & then APPLY ALTER column... XML type...

punjwani on 6/22/2009
Need more detail as you mentioned in your video how to check XML before conversion.

Carla Wilson on 6/22/2009
A tip for how to go about finding the rows that have xml errors would be good.

Caleb Bell on 7/16/2009
Great video, thanks for explaining how to do it and some caveats!

Scott Taylor on 9/24/2010
should also include examples for (1) timing operation against samples of full data set to convert and (2) how to work around bad data in new xml column

Dana on 10/15/2010
More on XML datatype please

dba on 1/7/2011
next time you do a quiz at the end of a video, you may want to remove the answer from view (in this case, you asked "what is the syntax to convert a column to xml datatype" while the "alter table" command was still in view...)

Michal on 1/7/2011
The author just scratched the subject..

David Washington on 1/7/2011
Would like to see a section on how to actually identify and fix the bad XML data in the TEXT field prior to altering the column type.

Thomas Kelley on 1/7/2011
What are some techniques that can be used to clean up the format of your text data before converting to an XML column?

32DE12EB89 on 1/7/2011
Some clues about how to identify rows with bad XML would have been helpful.

Matthew on 1/7/2011
Short and concise which is great.

Mark Clancy on 1/7/2011
Didn't really address my problem: unstructured TEXT fields.

Jonathan Hara on 1/7/2011
Didn't really learn anything here. I was hoping for methods of actually cleaning up the data or validating.

Jamshid Nouri on 1/7/2011
excellent demo

Marcelo Marim on 1/7/2011
A bit to simple and too fast... Maybe next time we should see a way to do the cleanup as you mentioned. If I have 1000 rows and I have to go over all of those rows and look for good or bad XML it will take me forever... we should have a script that will help doing this cleanup. Thanks anyway.

Bridget on 1/10/2011
like the XML education

Mohamed Irshad on 1/13/2011
good, informative

Mohamed Irshad on 1/13/2011
good, informative

Dean Gross on 2/9/2011
the suggestion for evaluating the duration was a nice addition to the basic instruction

Don Gilman on 4/6/2011
A bit too quick and dirty. Should have mentioned WHY you would want to convert to XML.

John O'Sullivan on 8/9/2011
good tip

George Heinrich on 8/9/2011
It would be nice if it touched on the advantages to the XML column.

Dennis Allen on 8/9/2011
While it can be a disk space issue and it raises the time to convert, I prefer appending a new XML column and then performing a row by row update to move the data from the text column to the XML column. This way you can identify which columns will not convert and you never grab a table lock.

kishor on 9/12/2011
nice video

Eric Moreau on 11/29/2011
the video is cut when it becomes intesting!

William on 11/29/2011
Even though this video talked about upgrading from sql 2000 to sql 2005, it's still applicable to 2008 / 2008 R2.

Frank on 11/29/2011
Unfortunately, I cannot evaluate the content because the video quality was awful

gavriel on 12/1/2011
yes to short why not explain abit more on the data type xml

Steve Harris on 12/2/2011
maybe mention the other video name for reference or talk about what the conversion problems could be again

Maurice Ivory on 1/11/2012
I think I understand what's going on here....Before you use alter, figure out how many rows you are returning.

John O'Sullivan on 1/19/2012
a little simplistic



Must Be Logged In
 

How Do I Become a Video Author? |  Newsletter History

Copyright © Fourdeuce, Inc., 2005-2009. All Rights Reserved | Privacy Policy | Terms & Conditions