query returns wrong result

  • Hello all,

    I have used DTS to load a flat file into a table. After the load was finished, I ran "Select count(1) from table1" from Query Analyser and I get zero. However, in Enterprise Manager, I see over 2 billion rows and can query the data and see it. When I run "Select top 1 * from table1" from Query Analyser, I get nothing. What is going on?

  • Is it possible that you are looking at two different tables with two different owners?

    Run this to see if there is more than one table of the same name owner by two different users:

    select u.name from sysobjects o join sysusers u on o.uid=u.uid where o.type = 'u' and o.name = 'YourTableName'

    If not then I'm stumped... maybe the wrong database?... wrong server?... wrong planet?

  • I was in the wrong database, you are right, I am still not used to changing databases. Sorry!

  • Don't worry... I think we've all done that before 🙂

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply