Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2004
    Posts
    2

    Unanswered: Query doesn't find existing data

    SQL Server 2000 Enterprise

    While testing an update script I found that a number of data rows are inaccessible using my query, though the data does exist in the table. I can browse records to find the data or query the record by some column names, but not by others.

    For example:

    SELECT name FROM tblPersonalInformation WHERE [ID Number] = 2358899;

    would not find the data sought. However, if I put in:

    SELECT address FROM tblPersonalInformation WHERE name = ‘Doe, John’;

    the query yields the desired data. Many of the records queried display the specified data with no problem. I have found this problem to exist on a number of data rows, but can’t figure out a reason. The front-end application displays the data without any apparent problems.

    Ideas please.

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    On the surface, it doesn't seem plausable...

    Post the DDL of the Table, so we can see...
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Service pack #?
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Trailing spaces, perhaps?

    What is the datatype of [ID Number]?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Do this and let us know what you get:

    select * from tblPersonalInformation where charindex(char(160), [ID Number]) > 0
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  6. #6
    Join Date
    Jul 2004
    Posts
    52
    I have seen corrupt indexes cause this. Try

    dbcc dbreindex ('tblPersonalInformation')

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •