Solved

DataSet Usage In SQL statements

Posted on 2004-08-02
3
185 Views
Last Modified: 2006-11-17
Hello,

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;
i.e.
<account>
 ID = "dasdfds"
</account>
<account>
 ID = "asdfda"
</account>

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 :)

thanks
0
Comment
Question by:simsingh
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 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:

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

In which case, it would be trivial.

0
 

Author Comment

by:simsingh
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 :)
0
 
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?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now