请告诉我XML代码的处理方式只有几行 [英] Please Tell me the maning of XML Code only few lines

查看:89
本文介绍了请告诉我XML代码的处理方式只有几行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,先生,
我有一个xml过程,我做了整个过程,但是我复制的某些行粘贴了whoes的含义,我不清楚,请告诉我它的含义....


SET ARITHABORT ON
是什么意思

Hello Sir,
I have an xml procedure I made whole procedure but some lines I did copy paste whoes meaning is not clear to me please tell me the meaning of it....


What is the meaning of SET ARITHABORT ON

create PROCEDURE [dbo].[proc_DailyWork]        
@xmlTbl xml
as    
set ARITHABORT ON 
INSERT  INTO M_DailyworkReport(StartTime,EndTime,ProjectId,ModuleId,EntityId,WorkType,StatusId)           
SELECT              
   doc.col.value('StartTime[1]','varchar(5)')as StartTime,          
   doc.col.value('EndTime[1]','varchar(5)')as EndTime,        
   doc.col.value('ProjectName[1]','int')as ProjectName,        
   doc.col.value('ModuleName[1]','int')as ModuleName,          
   doc.col.value('EntityName[1]','int')as EntityName, 
   doc.col.value('WorkType[1]','varchar(100)')as WorkType,
   doc.col.value('Status[1]','int')as Status         
          
           
FROM  @xmlTbl.nodes('/DWR/Insertxml') as doc(col); --What is the meaning of doc(col)         
if(@@error <> 0)          
return -1          
else           
return 0

推荐答案

在查询执行期间发生溢出或被零除错误时,终止查询.
http://msdn.microsoft.com/en-us/library/ms190306.aspx [ ^ ]
Terminates a query when an overflow or divide-by-zero error occurs during query execution.
http://msdn.microsoft.com/en-us/library/ms190306.aspx[^]


要了解SET ARITHABORT ON 的好处是在过程中注释一下,看看会发生什么.

或阅读此页面: http://msdn.microsoft.com/en-us/library/ms190306.aspx [^ ]

关于"doc(col)是什么意思"

这意味着创建一个名为doc的表,并将来自 @xmlTbl.nodes(''/DWR/Insertxml'')的xml节点插入到名为col
的列中 所以我认为doc.col.value现在很有意义.

希望对您有所帮助.
To learn what is the benefit of SET ARITHABORT ON comment it out in the procedure and see what happens.

Or read this page : http://msdn.microsoft.com/en-us/library/ms190306.aspx[^]

and about "What is the meaning of doc(col)"

It means that create a table named doc and insert xml nodes from @xmlTbl.nodes(''/DWR/Insertxml'') into a column named col
So I think doc.col.value makes sense now.

Hope it helps.


这篇关于请告诉我XML代码的处理方式只有几行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆