Search code examples
sqlsql-servert-sqlsql-server-2000

SQL Server column select query behaving strangely


When I do a select * over the table, the column Qty & QtyPending show a value of 6. However explicitly selecting the column names shows different values. Can anyone shed some light as to why this behavior is occurring?

This is a legacy system and database used is SQL Server 2000. The column data types are smallint.

enter image description here

So I have explicitly updated QtyPending to 6 using an Update query. This column now shows correct value.

Also added locstockid to the query, column Qty still shows different values.

enter image description here


Solution

  • Whatever I see in the image provided both the query have different LocStockId which means they can have different values

    First : LocStockId = 152319

    Second : LocStockId = 153219

    I think you have mistyped.