Click here to Skip to main content
15,886,639 members
Home / Discussions / Database
   

Database

 
GeneralRe: Product of Salary Pin
Jörgen Andersson16-Mar-11 1:09
professionalJörgen Andersson16-Mar-11 1:09 
AnswerRe: Product of Salary Pin
Pete O'Hanlon15-Mar-11 23:35
mvePete O'Hanlon15-Mar-11 23:35 
AnswerRe: Product of Salary Pin
RyanEK16-Mar-11 15:04
RyanEK16-Mar-11 15:04 
GeneralRe: Product of Salary Pin
Anubhava Dimri16-Mar-11 18:28
Anubhava Dimri16-Mar-11 18:28 
GeneralRe: Product of Salary Pin
RyanEK16-Mar-11 18:45
RyanEK16-Mar-11 18:45 
GeneralRe: Product of Salary Pin
Anubhava Dimri16-Mar-11 21:24
Anubhava Dimri16-Mar-11 21:24 
AnswerRe: Product of Salary Pin
Wendelius19-Mar-11 10:55
mentorWendelius19-Mar-11 10:55 
Questionhow to user OPENXML and relate information of two different table data..... [modified] Pin
Sasmi_Office14-Mar-11 21:01
Sasmi_Office14-Mar-11 21:01 
Dear Friends,

<List>
  <Entry>
    <id>1</uid>
    <lastName>abc</lastName>
    <idList>
      <id>
        <id>1</uid>
        <idType>pqr</idType>
        <idNumber>1001</idNumber>
        <idCountry>INDIA</idCountry>
      </id>
      <id>
        <id>2</uid>
        <idType>xyz</idType>
        <idNumber>1002</idNumber>
        <idCountry>USA</idCountry>
      </id>
    </idList>
  </Entry>


Above is the xml i have in my database i want to read this information and return output as given below


id LastName id idType idNumber idCountry
1 abc 1 pqr 1001 INDIA
1 abc 2 xyz 2001 USA


i am using OPENXML in my stored procedure the code is as given below

DECLARE @HANDLE INT
DECLARE @XMLDOC XML

SET @XMLDOC = (select ofacList from tbl_OFAC_SDN_List)

    EXEC SP_XML_PREPAREDOCUMENT  @HANDLE OUTPUT,@XMLDOC

SELECT * FROM OPENXML(@HANDLE, '/List/Entry', 2)
WITH ([id] int, lastName nvarchar(100))

            EXEC sp_xml_removedocument @HANDLE


till this all working fine but i don't know how to relate the id information with the main data and how to get the output

as well as if i want to add this information into two table (tblmainTable and idDetailsTable) how i will manage it's relation.

tblmainTable Record
id LastName
1 abc

idDetailsTable Records
uid id idType idNumber idCountry
1 1 pqr 1001 INDIA
1 2 xyz 2001 USA

please help me to come out of this.


thanks and regard's in advance
Sasmi
modified on Tuesday, March 15, 2011 3:35 AM

QuestionHow to send data from DB to all running application X's... Pin
Sander Rossel14-Mar-11 11:30
professionalSander Rossel14-Mar-11 11:30 
AnswerRe: How to send data from DB to all running application X's... Pin
Wendelius14-Mar-11 11:56
mentorWendelius14-Mar-11 11:56 
GeneralRe: How to send data from DB to all running application X's... Pin
Sander Rossel14-Mar-11 12:36
professionalSander Rossel14-Mar-11 12:36 
GeneralRe: How to send data from DB to all running application X's... Pin
Wendelius14-Mar-11 12:42
mentorWendelius14-Mar-11 12:42 
GeneralRe: How to send data from DB to all running application X's... Pin
Sander Rossel14-Mar-11 13:24
professionalSander Rossel14-Mar-11 13:24 
GeneralRe: How to send data from DB to all running application X's... Pin
Luc Pattyn14-Mar-11 13:43
sitebuilderLuc Pattyn14-Mar-11 13:43 
GeneralRe: How to send data from DB to all running application X's... Pin
Wendelius14-Mar-11 19:24
mentorWendelius14-Mar-11 19:24 
JokeRe: How to send data from DB to all running application X's... Pin
Sander Rossel14-Mar-11 21:15
professionalSander Rossel14-Mar-11 21:15 
GeneralRe: How to send data from DB to all running application X's... Pin
Wendelius14-Mar-11 19:23
mentorWendelius14-Mar-11 19:23 
AnswerRe: How to send data from DB to all running application X's... Pin
jschell15-Mar-11 7:59
jschell15-Mar-11 7:59 
GeneralRe: How to send data from DB to all running application X's... Pin
Sander Rossel15-Mar-11 8:21
professionalSander Rossel15-Mar-11 8:21 
GeneralRe: How to send data from DB to all running application X's... Pin
jschell16-Mar-11 8:21
jschell16-Mar-11 8:21 
AnswerRe: How to send data from DB to all running application X's... Pin
Klaus-Werner Konrad16-Mar-11 8:00
Klaus-Werner Konrad16-Mar-11 8:00 
QuestionMySql connector and VS2010 SP1 Pin
Daniele Fusi14-Mar-11 4:59
Daniele Fusi14-Mar-11 4:59 
QuestionHow to create user 'sa' on Sql Server Pin
AmbiguousName12-Mar-11 4:25
AmbiguousName12-Mar-11 4:25 
AnswerRe: How to create user 'sa' on Sql Server [modified] Pin
Wendelius12-Mar-11 6:14
mentorWendelius12-Mar-11 6:14 
AnswerRe: How to create user 'sa' on Sql Server Pin
jschell13-Mar-11 10:19
jschell13-Mar-11 10:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.