473,378 Members | 1,309 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Working wth XML

I've built an application that relies pretty heavily on XML to enable
flexible creation of data entry forms and storage of the data entered
into those forms. Currently, it stores data as an XML document in an
ntext field. This is great because it allows me a great deal of
flexibility in creating fields. However, I need to implement searching
and sorting of that data and I don't know how to do this in an efficient
manner.

Currently the data is stored in a format similar to this:
<form>
<fieldname>fieldvalue</fieldname>
<listfieldname>
<items>
<item>
<label>displaytext</label>
<value>itemvalue</label>
</item>
</items>
</listfieldname>
</form>

Is there any way to perform searches on data like this, i.e. to search
the "fieldvalue" in <fieldname> or "itemvalue" in <value>?

If there isn't a way to do this, I'm willing to re-structure the
databast architecture, though the solution would still need to allow the
same kind of flexibility that the XML solution does.

Any ideas?

Thanks,
Kelly
Jul 20 '05 #1
4 1190
Kelly Ford (no**********@knowbetter.com) writes:
I've built an application that relies pretty heavily on XML to enable
flexible creation of data entry forms and storage of the data entered
into those forms. Currently, it stores data as an XML document in an
ntext field. This is great because it allows me a great deal of
flexibility in creating fields. However, I need to implement searching
and sorting of that data and I don't know how to do this in an efficient
manner.

Currently the data is stored in a format similar to this:
<form>
<fieldname>fieldvalue</fieldname>
<listfieldname>
<items>
<item>
<label>displaytext</label>
<value>itemvalue</label>
</item>
</items>
</listfieldname>
</form>

Is there any way to perform searches on data like this, i.e. to search
the "fieldvalue" in <fieldname> or "itemvalue" in <value>?


You have the patindex function which should work with ntext columns. It
does not know about XML through...

Next version of SQL Server, which currently is in beta, will have
extensively better XML support. There is an XML datatype, you can
create XML indexes, and you can use XQuery.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
Thanks Erland. That seems to work great. Do you know how well patindex
scales? If the query is searching 1000 or 10000 records, is this still a
viable solution?

Kelly

In article <Xn********************@127.0.0.1>, es****@sommarskog.se
says...

You have the patindex function which should work with ntext columns. It
does not know about XML through...

Next version of SQL Server, which currently is in beta, will have
extensively better XML support. There is an XML datatype, you can
create XML indexes, and you can use XQuery.

Jul 20 '05 #3
Kelly Ford (no**********@knowbetter.com) writes:
Thanks Erland. That seems to work great. Do you know how well patindex
scales? If the query is searching 1000 or 10000 records, is this still a
viable solution?


If you have 10000 rows with ntext column with XML data in them, I would
not expect subsecond response time. If you need good response time, in
SQL2000 you would have to shred the documents with OPENXML and store
the data relationally in tables.

Also, I would advice you check that patindex is able to get past the
4000th character, because I know that there have been bugs in this area.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #4
I'm really surprised that you're storing the file in a database field...
kinda defeats the purpose, I think. I would read and write to the XML file
directly and bypass the database. It's much quicker for a web server to
read/write to the file system than from a DB. The XML file itself becomes a
database of sorts and it would be searchable through script
(asp,.net,cfml,jsp,php). Sounds like a cool idea nevertheless.

Rob

"Kelly Ford" <no**********@knowbetter.com> wrote in message
news:MP************************@news.west.cox.net. ..
I've built an application that relies pretty heavily on XML to enable
flexible creation of data entry forms and storage of the data entered
into those forms. Currently, it stores data as an XML document in an
ntext field. This is great because it allows me a great deal of
flexibility in creating fields. However, I need to implement searching
and sorting of that data and I don't know how to do this in an efficient
manner.

Currently the data is stored in a format similar to this:
<form>
<fieldname>fieldvalue</fieldname>
<listfieldname>
<items>
<item>
<label>displaytext</label>
<value>itemvalue</label>
</item>
</items>
</listfieldname>
</form>

Is there any way to perform searches on data like this, i.e. to search
the "fieldvalue" in <fieldname> or "itemvalue" in <value>?

If there isn't a way to do this, I'm willing to re-structure the
databast architecture, though the solution would still need to allow the
same kind of flexibility that the XML solution does.

Any ideas?

Thanks,
Kelly

Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mullin Yu | last post by:
hi, i have a web service that has file operations on Windows OS, and there may be a file concurrency issue if only one working directory e.g. c:\working therefore, i want to have a unique sub...
5
by: Martin Heuckeroth | last post by:
Hi We are working on a webservice application and are having some problems with the cookies and/or sessions. We have them working on our intranet but then its not working on the internet. We...
5
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
8
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs...
2
by: Don | last post by:
I'm having problems with intellisense, autocomplete, etc. suddenly not working in certain classes of a project I'm working on. All the options are set, and it all works fine for most classes, but...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
4
by: qbproger | last post by:
I'm developing a plugin for some software. The previous version of the software didn't require a start in directory to be set. This allowed me to leave the working directory to the default in the...
3
by: Jason Huang | last post by:
Hi, In our C# Windows Form application, we are using the SQL Server 2000 as the database server. The Database table MyTable has a field RegistrationDate which represents the Date a client comes...
0
by: WORKING IN FAITH | last post by:
three years I LOVE You Monica More options 1 message - Collapse all WORKING IN FAITH View profile More options Nov 13, 11:29 am three years I LOVE You Monica
3
by: lds | last post by:
On our server we have both applications that have been migrated to use v2.0 of the framework as well as apps that have not yet been migrated and still use 1.1. When I tried to deploy my v2.0 app...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.