sql2005中插入xml数据
update tb_BuySell set bsExtend='
<buysell>
<barnd>产品品牌:DB线'+convert(varchar(20),@i)+'</barnd>
<currentPrice>当前价钱:0.10元</currentPrice>
<orderMin>最小起订:不限</orderMin>
<buyTotalCount>供货总量:不限</buyTotalCount>
<sendDate>发贷总量:不限</sendDate>
<address>所在地:中国广东省深圳市</address>
<availabilityDate>有效期至:2010年09月22日</availabilityDate>
<packDescription>包装说明:???</packDescription>
<logisticsDescription>物流说明:???</logisticsDescription>
</buysell>' where bsID=11
insert into tb_BuySell values('<buysell>
<barnd>DB线'+convert(varchar(20),@i)+'</barnd>
<currentPrice>0.10元</currentPrice>
<orderMin>不限</orderMin>
<buyTotalCount>不限</buyTotalCount>
<sendDate>不限</sendDate>
<address>中国广东省深圳市</address>
<availabilityDate>2010年09月22日</availabilityDate>
<packDescription>???</packDescription>
<logisticsDescription>???</logisticsDescription>
</buysell>')
上面的xml节点已经固定,我想让它更加灵活,自由的变动?
在服务器端怎样通过代码对xml数据进行统一组织(最好有一个操作xml数据的类),然后在往数据库中插入,查询的时候也可以更加方便一些
[解决办法]
建议将
<buysell>
<barnd>产品品牌:DB线'+convert(varchar(20),@i)+'</barnd>
<currentPrice>当前价钱:0.10元</currentPrice>
<orderMin>最小起订:不限</orderMin>
<buyTotalCount>供货总量:不限</buyTotalCount>
<sendDate>发贷总量:不限</sendDate>
<address>所在地:中国广东省深圳市</address>
<availabilityDate>有效期至:2010年09月22日</availabilityDate>
<packDescription>包装说明:???</packDescription>
<logisticsDescription>物流说明:???</logisticsDescription>
</buysell>
这些xml文件都拆分开存放到DB中,需要的时候再通过xml拼接来实现,你这样都写死了,要是记录很多
你就麻烦了,而且不容易维护。