Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
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

SQL
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
Posted
Updated 24-Dec-11 0:38am
v3

Terminates a query when an overflow or divide-by-zero error occurs during query execution.
http://msdn.microsoft.com/en-us/library/ms190306.aspx[^]
 
Share this answer
 
Comments
Prashant Srivastava LKO 24-Dec-11 9:03am    
Thanks Sir a nice link for me, my 5 for you
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.
 
Share this answer
 
Comments
Prashant Srivastava LKO 24-Dec-11 9:03am    
Thanks Sir to you also for this answer my 5 for you
Amir Mahfoozi 24-Dec-11 10:35am    
However I'm not Sir, but you're welcome ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900