Baq distinct not working, but works in test

,

I have a baq that has a distinct option set. In our production environment it pulls all items, even duplicates). I can import the same query into our test data base, which is up to date, and distinct does not return duplicates as expected. What would cause this in our production environment? In production I get 235 lines in test I get 55 lines. This is very concerning.

Very hard to help with such limited information. :confused:

Please read this post and provide more information if you would still like some assistance: Tips for asking question on the forum

1 Like

Couple of things I would try that’s if you can take down your Production SQL server.

  • Delete and Reimport your BAQ to live
  • Restart your Prod SQL Server
  • Recycle your application pool

My guess is that your sql server in Production has not been restarted in a while and your query cache is messed up.

Do you perform regular SQL server maintenance? (i.e. reindexing, backups, restarts)?

Failing that I’d be wanting to take a look at SQL profiler run the baq in both test and live and compare…

A manager once said to me “Avoid Distinct as much as possible” I tend to agree as it can impact if you are using it on large datasets.