易截截图软件、单文件、免安装、纯绿色、仅160KB

SQL XML DELETE

--A. 从存储在非类型化的 xml 变量中的文档中删除节点
DECLARE @myDoc xml
SET @myDoc = '<?Instructions for=TheWC.exe ?>
<Root>
 <!-- instructions for the 1st work center -->
<Location LocationID="10" LaborHours="1.1" MachineHours=".2" >
 Some text 1
 <step>Manufacturing step 1 at this work center</step>
 <step>Manufacturing step 2 at this work center</step>
</Location>
</Root>'
SELECT @myDoc
-- delete an attribute
SET @myDoc.modify('
  delete /Root/Location/@MachineHours
')
SELECT @myDoc
-- delete an element
SET @myDoc.modify('
  delete /Root/Location/step[2]
')
SELECT @myDoc
-- delete text node (in <Location>
SET @myDoc.modify('
  delete /Root/Location/text()
')
SELECT @myDoc
-- delete all processing instructions
SET @myDoc.modify('
  delete //processing-instruction()
')
SELECT @myDoc
--B. 从存储在非类型化的 xml 列中的文档中删除节点
delete XML DML 语句从存储在列中的文档中删除 <Features> 的第二个子元素。
CREATE TABLE #T (i int, x xml)
go
INSERT INTO #T VALUES(1,'<Root>
<ProductDescription ProductID="1" ProductName="Road Bike">
 <Features>
   <Warranty>1 year parts and labor</Warranty>
   <Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
 </Features>
</ProductDescription>
</Root>')
go
-- verify the contents before delete,query返回Features元素下的所有节点,以XML格式返回
SELECT x.query('//ProductDescription/Features')
from #T
-- delete the second feature
UPDATE #T
SET x.modify('delete /Root/ProductDescription/Features/*[2]')
-- verify the deletion
SELECT x.query(' //ProductDescription/Features')
from #T
DROP TABLE #T
C. 从非类型化的 xml 列中删除节点
create table #T(ProductModelID int primary key,
Instructions xml )
go
insert  #T
select ProductModelID, Instructions
from Prod


相关文档:

航空公司管理系统(VC++ 与SQL 2005)

系统环境:Windows 7
软件环境:Visual C++ 2008 SP1 +SQL Server 2005
本次目的:编写一个航空管理系统
      这是数据库课程设计的成果,虽然成绩不佳,但是作为我用VC++ 以来编写的最大程序还是传到网上,以供参考。用VC++ 做数据库设计并不容易,但也不是不可能。以下是我的程序界面,后面 ......

SQL中CONVERT转化函数的用法

摘自:http://www.cnblogs.com/dicky/archive/2007/01/12/618453.html
格式:
CONVERT(data_type,expression[,style])
说明:
此样式一般在时间类型(datetime,smalldatetime)与字符串类型(nchar,nvarchar,char,varchar)
相互转换的时候才用到.
例子:
SELECT CONVERT(varchar(30),getdate(),101) now
结果为 ......

从xml读取游戏配置信息或保存

 /*
* 主要作用;
* 从xml读取游戏配置信息或保存
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Forms;
using System.IO;
using System.Xml;
using System.Reflection;
namespace Game
{
class Config
{
Ke ......

sql 表连接

TA:
1,WANG
2,ZHANG
4,LI
TB:
1,100
2,200
3,400
1.left join 左连接--以左表为基准,右表中没值的,在结果集中以null值代替。(select * from TA left join TB where TA.ID=TB.ID)
   1,WANG,100
   2,ZHANG,200
   4,NULL
2.right join 右连接--以右表为基准,左表中没值的,在 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号