declare @xmlCustomer xml
set @xmlCustomer =' <customer xmlns:C="http://schemas.mybook.com/customerschemas">
<item ID="1">
<customername>北方书城 </customername>
<address>北京市海淀区知春路22号 </address>
<phone>2222222 </phone>
<contact>刘先生 </contact>
</item>
</customer>' -- 删除一个元素
SET @xmlCustomer.modify('
delete /customer/item[@ID=1]/phone
')
SELECT @xmlCustomer
运行结果是: <customer xmlns:C="http://schemas.mybook.com/customerschemas">
<item ID="1">
<customername>北方书城 </customername>
<address>北京市海淀区知春路22号 </address>
<contact>刘先生 </contact>
</item>
</customer>
===============================================
上面是正确的,疑问如下:
<C:customer xmlns:C="http://schemas.mybook.com/customerschemas">
<item ID="1">
<customername>北方书城 </customername>
<address>北京市海淀区知春路22号 </address>
<phone>2222222 </phone>
<contact>刘先生 </contact>
</item>
</C:customer> -- 删除一个元素
SET @xmlCustomer.modify('
delete /customer/item[@ID=1]/phone
') 注意蓝色处是需要修正的! 想要得到上面的运行结果...
set @xmlCustomer =' <customer xmlns:C="http://schemas.mybook.com/customerschemas">
<item ID="1">
<customername>北方书城 </customername>
<address>北京市海淀区知春路22号 </address>
<phone>2222222 </phone>
<contact>刘先生 </contact>
</item>
</customer>' -- 删除一个元素
SET @xmlCustomer.modify('
delete /customer/item[@ID=1]/phone
')
SELECT @xmlCustomer
运行结果是: <customer xmlns:C="http://schemas.mybook.com/customerschemas">
<item ID="1">
<customername>北方书城 </customername>
<address>北京市海淀区知春路22号 </address>
<contact>刘先生 </contact>
</item>
</customer>
===============================================
上面是正确的,疑问如下:
<C:customer xmlns:C="http://schemas.mybook.com/customerschemas">
<item ID="1">
<customername>北方书城 </customername>
<address>北京市海淀区知春路22号 </address>
<phone>2222222 </phone>
<contact>刘先生 </contact>
</item>
</C:customer> -- 删除一个元素
SET @xmlCustomer.modify('
delete /customer/item[@ID=1]/phone
') 注意蓝色处是需要修正的! 想要得到上面的运行结果...
解决方案 »
- 我想为公司开发一个财务软件(b/s模式),买哪本书学习一下比较好
- 如何得到listview的key?
- 如何取得checkboxlist所以选中的项,将它们存如数据库的一个字段?
- ASP.NET(C#)+Access转成SQL数据库,要改哪些东西,怎么改
- 大问题哦
- 关于remoting c/s结果连接的问题
- 我是初学者,求助
- WebService的怪问题......
- 微软输掉官司 Windows必须嵌Java!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 该死的考试完了,放假了又可以搞c#了,高兴啊!csdn的同僚们加油!
- 怎么样用循环实现, checkbox选中后 赋值给 数组
- 有实体框架的学习资料吗?
<customer ><C:customer >注意蓝色处:customer 是要修正的
delete /customer/item[@ID=1]/phone
等号上下的区别就在于:</C:customer> 和</customer>这个