jenlion
IS-IT--Management
- Nov 13, 2001
- 215
I have a view that has been running for six months with no problems. Suddenly today it stops working.
I have a table tsoPackage that has a packagekey int. I have another table (call it tableB) with a packagekey varchar(20). They both must be this data type -- an application requires packagekey int, and UPS only writes back character values to sql.
I'm selecting a bunch of stuff from tsoPackage where packagekey not in (select packagekey from tableB).
This used to work FINE. We're up to packagekey 51470 now. Now, selecting * from tsoPackage where packagekey not in (select packagekey from tableB) returns nothing, even though the packagekey is not in tableB.
I tried, for kicks, selecting convert(int,packagekey) as Packagekey into #t, and then select * from tsopackage where packagekey not in (select packagekey from #t), and THAT doesn't get me anything, so it's not the int-varchar thing.
This makes NO sense to me. Why would "not in" suddenly fail for everything?
For now I've modified the view to select stuff from tsopackage p left join TableB b on p.packagekey = b.packageey where b.packagey is null. That's working fine.
But I'm concerned. This shouldn't just quit working.
Here's another weird one. If I select * from tableB, there are 41705 records. If I select * from tableB where packagekey in (select packagekey from tableB), I only get 41704. Change the "in" to "not in" and there are no results. Where's the missing record??
Someone point me in the right direction here? Never seen this??
Thanks!
I have a table tsoPackage that has a packagekey int. I have another table (call it tableB) with a packagekey varchar(20). They both must be this data type -- an application requires packagekey int, and UPS only writes back character values to sql.
I'm selecting a bunch of stuff from tsoPackage where packagekey not in (select packagekey from tableB).
This used to work FINE. We're up to packagekey 51470 now. Now, selecting * from tsoPackage where packagekey not in (select packagekey from tableB) returns nothing, even though the packagekey is not in tableB.
I tried, for kicks, selecting convert(int,packagekey) as Packagekey into #t, and then select * from tsopackage where packagekey not in (select packagekey from #t), and THAT doesn't get me anything, so it's not the int-varchar thing.
This makes NO sense to me. Why would "not in" suddenly fail for everything?
For now I've modified the view to select stuff from tsopackage p left join TableB b on p.packagekey = b.packageey where b.packagey is null. That's working fine.
But I'm concerned. This shouldn't just quit working.
Here's another weird one. If I select * from tableB, there are 41705 records. If I select * from tableB where packagekey in (select packagekey from tableB), I only get 41704. Change the "in" to "not in" and there are no results. Where's the missing record??
Someone point me in the right direction here? Never seen this??
Thanks!