The other day a user came to see me with a very strange error message. In fact the message is not that strange would it be associated with a regular table or transaction... I already dealt with PK violations, but this time it was affecting a temp table in the system (dbo.##0342219).
It all starts with the Item Maintenance window, where the user wanted to search for a specific set of Items starting with the string 'SOFT'. Using the lookup glass in the Item Number field, it opens the Items search box, and then using the find icon, opens the 'Smart-list' filter dialog box. There entering the information to search for Item Numbers that begins with 'SOFT', after clicking on OK, the system returns an error message :
Since it happens not in all GP companies, I can assume that it is depending maybe on some corrupted IV00101 entries... and I traced with the SDT and created a DexSQL.log file to analyse the operation. It is a very common SQL query that is calling up the IV00101 and IV00115 with a parse on ITEMNMBR LIKE 'SOFT%'...
I did a test with a different company where the search dialog box does not use the 'Smart-List' options, but rather a basic 'Find' option :
And this time the search returned all the values correctly with no errors. Curious about the query behind this search, I traced it as well with the SDT and figured out that the SQL query was even simpler, because it was looking only for the IV00101 table (and did not care about the IV00115).
Also, the test made in other companies with the 'SmartList' like search option, did not generate any PK errors, but the data set is also slightly smaller or different.
I know that the search options are set by user and by company, but could not remember where to change it, to carry on other tests. Does anybody remember where to switch this ?
Does anybody else had such strange temp table PK error and how could it be fixed ?
Thanks in advance for your hints
*This post is locked for comments