Hi Divya:
I'm just wondering, if you are using SQL Server 2000, why not use the native
support for XML... SELECT First_Name, Last_Name FROM SomeTable WHERE
Something = SomethingElse FOR XML AUTO ELEMENTS. You can then use the
XMLReader and do some pretty fancy stuff with it. The native support for
XML on the SQL Server side is pretty real and you can grab just about
anything client side once you have it.
If you really need to store each string in there and don't want to use the
XML features (BOL has some great examples) you can use something like WHERE
FieldName LIKE '<FieldName>%</FieldName>'
--
W.G. Ryan MVP Windows - Embedded
www.devbuzz.com
www.knowdotnet.com
http://www.msmvps.com/williamryan/
"Divya" <(E-Mail Removed)> wrote in message
news:72FF0822-B70F-4B99-B2BC-(E-Mail Removed)...
> Hi,
>
> I am trying to design a system such that I can store all of a user's
information as a XML string stored in a field in the database (SQL2000).
Let's say the XML string has XML tags such as first name, last name, phone
number, address etc. Is there a way to query the SQL database based on a XML
tag? eg: Can I query the database saying, select user id for all users with
last name = "Cooper" even though the last name of the user is embedded in
the xml string field of the table? (assuming that user id and the xml string
are fields in the database table)
>
> One way of doing this would be to read the xml string and then parse it.
But when I have a large number of users, this could get very slow. Is there
a better way of doing this?
>
> Thanks.
> -Divya