Getting Started with Adobe After Effects - Part 6: Motion Blur
Ask
Ask questions, discuss or help others by answering
Related Posts · View All
SQL Server 141
TSQL 75
SSRS 70
SSIS 66
XML 54

Top Categories · View All
SQL Server 141
TSQL 75
SSRS 70
SSIS 66
XML 54

Real Problem - Querying Serialized BLOB

Jul 27 2011 12:00AM by Angshuman Agarwal   

Hi,

I just love your posts and tutorials. Thanks for contributing. I have the following requirement and wanted to know if the solution is optimal performance wise -

I have a NTEXT column in a table which stores a serialized C++ / COM object, like a Property Bag - Key/Value pair (legacy design, can't help much). Now, this object can grow in size exponentially because it is configurable externally. The number of rows in this Table are 5,00,000 + in live scenario. I have to query this column for reporting purpose.

Solution (i am thinking) - Convert the COM / Object into XML and store as a separate column and then query this column and use in Dynamic SQL for report generation purpose?

Now, this XML schema can be different or same for each unique rows. The only way to uniquely identify is that the element under ROOT will have a type attribute like -

<ROOT xmlns:...>
  <Module type='Customer'/>
  <Country Name='India' State='Kerala' District=xsi:nil/>
...
</ROOT>

So, the user might now want to query , get me all customers whose District is NULL. So, like this there can be multiple columns and all columns should satisfactorily be part of the filter.

<ROOT xmlns:...>
  <Module type='Seller'/>
  <Product Name='Toy' Brand='Funskool'/>
...
</ROOT>

So, the user might now want to query , get me all sellers who sell Funskool toys. So, like this there can be multiple columns and all columns should satisfactorily be part of the filter.

Your advice is highly appreciated.

Submitted under:  · Microsoft SQL Server ·  ·  · 


Angshuman Agarwal
1554 · 0% · 12

1 Replies

  • Angushman,

    I guess the question you are trying to raise here is "can this be done within TSQL?" and my answer is YES. It is possible to query and extract the specific pieces of information using XQuery. You might need to use a combination of variables and dynamic XQuery expressions depending upon the specific use cases, but overall, can be done in TSQL.

    Number of rows are usually not a problem, but the size of individual XML values are important when it comes to performance. You might need to make use of XML Indexes as well.

    commented on Jul 27 2011 1:55AM
    Jacob Sebastian
    1 · 100% · 32004

Your Reply


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]