SqlDbx Forum

SqlDbx

You are not logged in.

#1 2020-11-13 01:50:57

JoseLauro
Member

Strange behavior in query/table, what could be wrong?

I asked this as a question on stackoverflow, you can check it here. But I'm going to paste it here, so you don't have to go to stackoverflow.


I have a service which is synchronizing 2 databases (software provider database, and our website database).

The website never changes the information, it only reads.

We have access to the software provider database connecting with SqlDbx (which I'm barely familiar with). The service synchronizing the databases is somewhat complicated, we have some parameters to see what tables gets synced and how. The service puts all the data into our SQL Server database and works fine. If we drop a table in SQL Server, the service rebuilds the whole table again.

But there is this case which is really weird.

I have this select on the SQL Server database which returns 4 rows:

SELECT SERIAL_NO
FROM TABLE
WHERE ID = 'D00357'
-- I get 4 rows from that.
-- let's say  SERIAL1, SERIAL2, SERIAL3 and SERIAL4

But if I go to SqlDbx and run that same query:

SELECT SERIAL_NO
FROM TABLE
WHERE ID = 'D00357'
-- I only get 2 rows
-- let's say  SERIAL1 and SERIAL2

Even more mysteriously, if I try to find the other 2 missing rows, by SERIAL_NO, they are there.

SELECT ID
FROM TABLE
WHERE SERIAL_NO = 'SERIAL3' OR SERIAL_NO = 'SERIAL4'
-- this results in 2 rows with 'D00357'

So, the software we using only shows the 2 rows we see from the first SELECT in SqlDbx. But the website shows the 4 rows from SQL Server, so they don't match.

We have dropped the table a few times and the syncing process always syncs back 4 rows.

Any ideas on how could I approach this? What can be causing this? Any suggestions will be very much appreciated.

Sorcery

Offline

#2 2020-11-13 07:54:21

sqldbxhelp
Administrator

Re: Strange behavior in query/table, what could be wrong?

Did you try to run these queries using SQL Server Management Studio?

Offline

Board footer

Powered by FluxBB