0
私がかなり長い間取り組んできたクエリは、ついには動作する。私はそれをSSRSレポートに実装するために取り組んできました。私は次のエラーが表示されたデータセットにクエリをコピー&ペーストしようとすると、しかし:SSRSでエラーが出るが、SSMSでクエリが完璧に動作する
SELECT failed because the following SET options have incorrect settings: 'ARITHABORT'.
Verify that SET options are correct for use with indexed views and/or indexes on computed
columns and/or filtered indexes and/or query notifications and/or XML data type methods
and/or spatial index operations.
今ARITHABORTは、データベース内の上に設定されています。これは確かです。 ssrsはarithabortを使用できませんか?
は、ここに私のクエリです:
SELECT DISTINCT WORK_ORDER.PART_ID, OPERATION.SEQUENCE_NO, OPERATION.RESOURCE_ID, OPERATION.SETUP_HRS, OPERATION.RUN_HRS,
OPERATION.OPERATION_TYPE, OPERATION.RUN AS PCS_HR, REPLACE(CONVERT(VARCHAR(150), CONVERT(BINARY(150), OPERATION_BINARY.BITS)), CHAR(0), '')
AS Specs_OPR, OPERATION.WORKORDER_BASE_ID, OPERATION.WORKORDER_LOT_ID, OPERATION.WORKORDER_SPLIT_ID,
OPERATION.WORKORDER_SUB_ID, OPERATION.LOAD_SIZE_QTY, OPERATION.CALC_START_QTY, OPERATION.COMPLETED_QTY,
(CEILING(OPERATION.CALC_START_QTY/OPERATION.LOAD_SIZE_QTY)) AS NUM_O_LOADS, ((OPERATION.CALC_START_QTY-OPERATION.COMPLETED_QTY)/OPERATION.LOAD_SIZE_QTY) AS LOADS_REMAINING,
(SELECT DISTINCT descriptions = STUFF((
SELECT ', ' + CHAR(13) + PART.DESCRIPTION FROM dbo.PART JOIN REQUIREMENT ON PART.ID = REQUIREMENT.PART_ID
WHERE REQUIREMENT.WORKORDER_BASE_ID = '026877' AND REQUIREMENT.OPERATION_SEQ_NO = OPERATION.SEQUENCE_NO
FOR XML PATH(''), TYPE).value('.[1]', 'nvarchar(max)'), 1, 2, '')
FROM (REQUIREMENT R JOIN PART P ON R.PART_ID = P.ID)) AS PART_DESCRIPTION
FROM OPERATION
INNER JOIN WORK_ORDER
ON OPERATION.WORKORDER_TYPE = WORK_ORDER.TYPE AND OPERATION.WORKORDER_BASE_ID = WORK_ORDER.BASE_ID AND
OPERATION.WORKORDER_LOT_ID = WORK_ORDER.LOT_ID AND OPERATION.WORKORDER_SPLIT_ID = WORK_ORDER.SPLIT_ID AND
OPERATION.WORKORDER_SUB_ID = WORK_ORDER.SUB_ID
INNER JOIN OPERATION_BINARY
ON OPERATION.WORKORDER_TYPE = OPERATION_BINARY.WORKORDER_TYPE AND
OPERATION.WORKORDER_BASE_ID = OPERATION_BINARY.WORKORDER_BASE_ID AND
OPERATION.WORKORDER_LOT_ID = OPERATION_BINARY.WORKORDER_LOT_ID AND
OPERATION.WORKORDER_SPLIT_ID = OPERATION_BINARY.WORKORDER_SPLIT_ID AND
OPERATION.WORKORDER_SUB_ID = OPERATION_BINARY.WORKORDER_SUB_ID AND
OPERATION.SEQUENCE_NO = OPERATION_BINARY.SEQUENCE_NO
JOIN REQUIREMENT
ON REQUIREMENT.WORKORDER_BASE_ID = OPERATION.WORKORDER_BASE_ID
WHERE (REPLACE(CONVERT(VARCHAR(8000), CONVERT(BINARY(8000), OPERATION_BINARY.BITS)), CHAR(0), '')
NOT LIKE '%Gupta%') AND OPERATION.WORKORDER_BASE_ID = '026877' AND WORK_ORDER.BASE_ID = '026877'
実際には、コードの書式設定とレイアウトを行う必要があります。このような混乱したSQLでは、どのように地球上で作業しますか? – iamdave
そのSQLのほとんどはSSRSによって生成されました。通常は、テーブル名ごとにエイリアスを使用して、混乱を減らします。 – Azuraith