Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Insert with XML Data

Author  Topic 

DeepakNewton
Starting Member

39 Posts

Posted - 2008-06-27 : 08:34:49
HI ALL
I have two tables that i need to insert into first table and using pkCoID, i need to insert the corresponding values into the second table
Please see the below table structure and XML data, give some idea to develop

tblCoSBusiness
pkCoId
fkAccountID

tblPoSBusiness
pkPoSId
posName
fkCoId
<Head>
<CoSBusiness>
<CD>
<Cond>Comments<Cond>
<Ps>
<PoS1>
<posName>John</posName>
</Parameter>
</Parameters>
</CD>
<CD>
<Cond>Comments1<Cond>
<Ps>
.
.
.
.
.
</CD>






visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-27 : 11:18:56
Use OPENXML to insert xml into table.I dont know where you'll get data for AccountID field from. Also the XML you posted is not a valid xml(there is a close parameter tag but without a start tag).

http://msdn.microsoft.com/en-us/library/ms186918.aspx
Go to Top of Page
   

- Advertisement -