Wednesday, March 21, 2012

save XML in a table

Im not talking about storing the attributes of the elements of an XML file
into different columns of tables(s) but saving the entire XML into a single
row and column as a blob ?
What would be the pros and cons of doing it as such ?
In SQL Server 2005, there is an XML datatype, which handles this quite well.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
"Hassan" <Hassan@.hotmail.com> wrote in message
news:uLY662iJGHA.516@.TK2MSFTNGP15.phx.gbl...
Im not talking about storing the attributes of the elements of an XML file
into different columns of tables(s) but saving the entire XML into a single
row and column as a blob ?
What would be the pros and cons of doing it as such ?
|||But curious about SQL 2000 ?
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:eiU9scmJGHA.648@.TK2MSFTNGP14.phx.gbl...
> In SQL Server 2005, there is an XML datatype, which handles this quite
> well.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:uLY662iJGHA.516@.TK2MSFTNGP15.phx.gbl...
> Im not talking about storing the attributes of the elements of an XML file
> into different columns of tables(s) but saving the entire XML into a
> single
> row and column as a blob ?
> What would be the pros and cons of doing it as such ?
>
>
|||Check "XML best practices" in BOL.
In short, when you don't need xml data type you need blob. And when you need
identical copy of the XML string, such as legal document, you need blob. I
mean varchar(max) by blob.
Pohwan Han. Seoul. Have a nice day.
"Hassan" <Hassan@.hotmail.com> wrote in message
news:uLY662iJGHA.516@.TK2MSFTNGP15.phx.gbl...
> Im not talking about storing the attributes of the elements of an XML file
> into different columns of tables(s) but saving the entire XML into a
> single row and column as a blob ?
> What would be the pros and cons of doing it as such ?
>
|||Some of the problems:
-How will you search for data in the column/row within the XML?
-If the XML document is 50MB, how will you insert the data? OPENXML will
require you to load the document into a variable, using a huge amount of
resources.
-In a table with 50,000 rows, how do you identify each XML document?
"Han" wrote:

> Check "XML best practices" in BOL.
> In short, when you don't need xml data type you need blob. And when you need
> identical copy of the XML string, such as legal document, you need blob. I
> mean varchar(max) by blob.
> --
> Pohwan Han. Seoul. Have a nice day.
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:uLY662iJGHA.516@.TK2MSFTNGP15.phx.gbl...
>
|||If you want to do any of that, I really recommend to upgrade to SQL Server
2005. SQL Server 2000 was not designed for managing XML documents as a unit
but for enabling relational integration into XML.
Best regards
Michael
"Sal Young" <SalYoung@.discussions.microsoft.com> wrote in message
news:3427C6A2-CD47-486F-A21A-646CAB18662D@.microsoft.com...[vbcol=seagreen]
> Some of the problems:
> -How will you search for data in the column/row within the XML?
> -If the XML document is 50MB, how will you insert the data? OPENXML will
> require you to load the document into a variable, using a huge amount of
> resources.
> -In a table with 50,000 rows, how do you identify each XML document?
> "Han" wrote:

No comments:

Post a Comment