Input:
The client claims that the application (.NET) returns some data when it requests some data, other than when the client looks directly at the data table.
I understand that there can be different reasons in completely different places. My goal is not to solve this problem here, but to ask experienced database and database developers if:
Is it possible for VIEW to display data that does not match the underlying TABLES?
- What are the possible reasons / reasons for this?
- Can an UPDATE statement in a view force future SELECTs to return βupdatedβ data when the table really does not work?
Possible reasons (comment on those who have question marks):
- the reason is that there are two separate transactions that explain customer confusion.
- base table has been changed but view has not been updated (using sp_refreshview)
- another user connects and can see different data due to permissions?
- programmer error: wrong tables / columns, wrong filters (all-in-one here)
- damage occurs: DBCC CHECKDB should help
- can
SELECT ... FOR UPDATE call this - ? __
What really happened (ANSWER):
The column positions have been changed in some tables: obviously, the client gave full access to the database for the consultant to analyze the use of the database. This great guy reordered the columns to see several audit fields at the beginning of the table when using SELECT * ... clauses.
Using dbGhost , the database schema was compared to the backup schema that was made a few days before the problem appeared, and differences in the column position were detected.
What happened next is not related to programming, but rather a matter of politics.
Therefore, the sp_refreshview solution was a solution. I just took one more step to find who caused the problem. Thanks to everyone.
sql sql-server schema
van
source share