Intermittent incorrect results in complex procedure generating XML

Naomi Nosonovsky 7,971 Reputation points
2023-06-06T18:45:48.6033333+00:00

Hi everybody,

Issue happened in production in 3 runs out of 32 so far. The complex stored procedure that generates XML didn't create names portion. If we run the code of this stored procedure in production we can reproduce the issue in about 1 run out of 10 or more. We never had same problem in Stage. Stage is SQL 2019 and production is SQL 2016. May we assume a bug in SQL Server if the same code when running multiple times produces different results (the underlying tables are not changing during the execution)?

Thanks in advance.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,147 questions
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 113.5K Reputation points MVP
    2023-06-06T21:18:23.9766667+00:00

    No, I don't think we can assume this. This can also be a case of indeterministic code. That is, code that can produce different results, depending on the phase of the moon etc. Or simply because the code is relying on something which does not have a strict definition.

    Of course, since we don't see the code, and we don't know the data, and we don't know what sort of XML it is supposed to produce, there is no way we can be very specific.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.