DataSet Usage In SQL statements

Posted on 2004-08-02
Medium Priority
Last Modified: 2006-11-17

so I have a database that contain's a table called accounts. The table's schema is:

ID              Username            Password

I also have an XML file which lists a bunch of ID's in it;
 ID = "dasdfds"
 ID = "asdfda"

Thus the xml file contains a bunch of ID's that I gather into a dataset, or datatable. My question is whether there is an easy way with SQL or MSSQL to acquire all the row's in the "accounts" table whose ID colum matches the ID values in the XML dataset?

Any help on this would be greatly appreciated :)

Question by:simsingh
  • 2
LVL 75

Accepted Solution

Anthony Perkins earned 1500 total points
ID: 11698007
If that was a well-formed Xml document you could OpenXml, unfortunately that is not a well formed Xml document.  Perhaps you can change it as follows:

      <account ID = "dasdfds"/>
      <account ID = "asdfda"/>

In which case, it would be trivial.


Author Comment

ID: 11698688
yah but the reason I want tha tis because my XML file contains certain accounts that I want to access at a certain time...so if I can somehow get all those ID's from my database table ithat would be great :)
LVL 75

Expert Comment

by:Anthony Perkins
ID: 11698718
As I said, if it is a well formed Xml document it is easy.  So do you have a well formed Xml document, so that I can give you some sample code using OpenXml?

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question