Hello all,
Wanted to share something that I'm running into in the hopes that one of our experts has run into it before.
I had seen inconsistent result sets out of a query I've been tweaking today. Sometimes 3640 results, sometimes 247520 results. Those are precise numbers, and I can't figure out what is causing the difference. Same query.
Copied the query via a Copy/Paste option in the Object Navigator. Run the copy. 3640 results. Run the original, 247520 results.
Some screenshots for clarity:
Copy, and results:
Original, and results:
(Cropped out the Employee Names that are the first column)
Copy, and results:
(Cropped out first column)
I'm really at a loss for why this is happening.
I don't really expect anyone to be able to troubleshoot my specific problem, but if anyone has seen a similar situation in their years of DBA work, I'd love to see some light shed on this $%&*# as it's becoming frustrating.
Editing to add:
I just noticed that the qry1 filter (that has the enormous resultset) has a "Filter" toggle that's not grayed out as it is on the copy. There's no active filter, though when I click the toggle, I get a prompt:
I should note that the table that these are being pulled from does in fact have a lookup field on "Employee" that is pulling in the FK from an Employees table elsewhere.
I'm still lost but will keep picking at threads--I hope someone can chime in here.
Edit 2:
I think I have a fix. In the Properties pane for qry1, there was a "filter" present that was filtering ON the lookup in the table.
This did not copy (or perhaps I inadvertently created it by clicking one of the filter dropdowns in the UI while working after making the copy?) into the duplicate query.
My (ongoing) confusion centers on the fact that aside from it trying to filter on an expression that's a lookup... Why would this happen? I would expect to cause it to run slowly, but not to end up with some weird matrix arithmetic that blows up the result set in this way.
I'm also eager to understand this so that I don't inadvertently do it again. Even with this "filter" toggled off, I never meant for any filter that I applied to be this persistent. I was able to just delete the filter from the Properties entry and now its gone, so that's good, at least...
Wanted to share something that I'm running into in the hopes that one of our experts has run into it before.
I had seen inconsistent result sets out of a query I've been tweaking today. Sometimes 3640 results, sometimes 247520 results. Those are precise numbers, and I can't figure out what is causing the difference. Same query.
Copied the query via a Copy/Paste option in the Object Navigator. Run the copy. 3640 results. Run the original, 247520 results.
Some screenshots for clarity:
Copy, and results:
Original, and results:
(Cropped out the Employee Names that are the first column)
Copy, and results:
(Cropped out first column)
I'm really at a loss for why this is happening.
I don't really expect anyone to be able to troubleshoot my specific problem, but if anyone has seen a similar situation in their years of DBA work, I'd love to see some light shed on this $%&*# as it's becoming frustrating.
Editing to add:
I just noticed that the qry1 filter (that has the enormous resultset) has a "Filter" toggle that's not grayed out as it is on the copy. There's no active filter, though when I click the toggle, I get a prompt:
I should note that the table that these are being pulled from does in fact have a lookup field on "Employee" that is pulling in the FK from an Employees table elsewhere.
I'm still lost but will keep picking at threads--I hope someone can chime in here.
Edit 2:
I think I have a fix. In the Properties pane for qry1, there was a "filter" present that was filtering ON the lookup in the table.
This did not copy (or perhaps I inadvertently created it by clicking one of the filter dropdowns in the UI while working after making the copy?) into the duplicate query.
My (ongoing) confusion centers on the fact that aside from it trying to filter on an expression that's a lookup... Why would this happen? I would expect to cause it to run slowly, but not to end up with some weird matrix arithmetic that blows up the result set in this way.
I'm also eager to understand this so that I don't inadvertently do it again. Even with this "filter" toggled off, I never meant for any filter that I applied to be this persistent. I was able to just delete the filter from the Properties entry and now its gone, so that's good, at least...
Last edited: