Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Msg 8155, Level 16, State 2, Line 41

Author  Topic 

dhrupit
Starting Member

2 Posts

Posted - 2013-09-13 : 06:05:54
SELECT * FROM
(SELECT ROW_NUMBER() OVER (ORDER BY ID asc) AS [ROW_NUMBER],* FROM
(SELECT * FROM
(SELECT WorkflowItem.*,
(SELECT Document.* ,
(SELECT HostApplicationLocalData.* FROM HostApplicationLocalData
WHERE HostApplicationLocalData.ID = Document.HostApplicationLocalData_ID FOR XML PATH('HostApplicationLocalData'), TYPE) ,
(SELECT DocumentMetaData.*,
(SELECT Field.* FROM Field WHERE Field.ID=DocumentMetaData.Field_ID FOR XML PATH('Field'), TYPE)
FROM DocumentMetaData WHERE DocumentMetaData.Document_ID=Document.ID FOR XML PATH('DocumentMetaData'), TYPE) AS DocumentMetaDatas
FROM Document WHERE WorkflowItem.Document_ID=Document.ID FOR XML PATH('Document'), TYPE)
FROM WorkflowItem as WorkflowItem
INNER JOIN PaperSaveWorkflow as PaperSaveWorkflow
ON PaperSaveWorkflow.ID = WorkflowItem.PaperSaveWorkflow_ID AND PaperSaveWorkflow.ID = 1
WHERE PaperSaveWorkflow.Published=1 AND WorkflowItem.CurrentOwner IS NOT NULL AND WorkflowItem.CurrentOwner<>'' AND (WorkflowItem.IsRunning = 1
OR ( WorkflowItem.IsRunning = 0 AND [dbo].[IsOneStringContainedInListOfOtherStringWhenTokenized]
('product development;miamimba\logonlocally',
LOWER(PaperSaveWorkflow.CanViewCompletedItems) + ';' + LOWER(PaperSaveWorkflow.WorkflowAdmin) ) = 1 ))
AND ([dbo].[IsOneStringContainedInListOfOtherStringWhenTokenized]
('dave\log on locally',
LOWER(WorkflowItem.CurrentOwner + ';' + LOWER(PaperSaveWorkflow.WorkflowAdmin) + ';' + LOWER(PaperSaveWorkflow.ViewPrinciples))) = 1)FOR XML PATH('WorkfLowItems'), TYPE)
as p
) AS T1) as T WHERE ROW_NUMBER between 1 and 2 FOR XML PATH ('MyTable') ,ROOT('ArrayOfWorkflowItem');

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-09-13 : 06:33:18
Refer http://blog.sqlauthority.com/2007/07/06/sql-server-fix-error-msg-8115-level-16-state-2-line-2-arithmetic-overflow-error-converting-expression-to-data-type/

Fix/Solution/Workaround:
1) Verify the inserted/updated value that it is of correct length and data type.
2) If inserted/updated value are correct modify the definition of the table to accommodated new data type length

--
Chandu
Go to Top of Page

dhrupit
Starting Member

2 Posts

Posted - 2013-09-13 : 06:38:59
sorry dear, but my issue is 8155 and not 8115.

But thanks for reply..
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2013-09-13 : 11:51:48
Do you understand what the error means?
Go to Top of Page
   

- Advertisement -