August 28, 2019 at 2:08 pm
We ran into a very strange error earlier this week that I wanted to share (and see if anyone might have any insights on).
We were running a query to review the processing status on a database instance. The query is almost identical to this one:
USE Northwind
GO
SELECT MAX(O.OrderDate) AS MaxOrdDt, MAX(O.ShippedDate) AS MaxShipDt
,COALESCE(C.CompanyName, O.CustomerID) AS Customer
FROM dbo.Orders O
LEFT OUTER JOIN MyLinkedSrv.Warehouse.dbo.Customers C
ON C.CustomerID = O.CustomerID
CROSS APPLY (SELECT DATEADD(dd,-30,MAX(OrderDate)) AS LastOrdDt FROM dbo.Orders) CA
WHERE O.OrderDate >= CA.LastOrdDt
GROUP BY COALESCE(C.CompanyName, O.CustomerID)
Running this query was fine for all but one database. One database resulted in the following error:
A severe error occurred on the current command. The results, if any, should be discarded.
Researching the problem, most of the sites indicated some sort of corruption.
• Removing the Linked server join and using a local "Customers" table, the query ran fine (ran this scenario 3x to make sure it was repeatable).
• We ran a DBCC CheckDB (Northwind) plus a DBCC CheckTable (both Northwind tables and the on the "Warehouse.dbo.Customers"), none of which produced errors (SQL Server had been updated to the latest released CU the previous week).
• Ran a backup to ensure there was nothing was causing an issue or an error might be generated indicating a possible IO issue, plus ensure we have a current copy in case more drastic measures are needed.
• Found some fragmented indexes on the "Orders" table. Did a defrag.
After the defrag, the "severe error" went away... what the heck????
Argue for your limitations, and sure enough they're yours (Richard Bach, Illusions)
August 29, 2019 at 2:10 pm
Thanks for posting your issue and hopefully someone will answer soon.
This is an automated bump to increase visibility of your question.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply