Query returns 13864 on a varchar columns

  • We have a customer that is running SQL2012 and we are seeing a weird result on a query when we run it on their db. It is based off of a table that has about 30 columns but in this case we only care about 2 of them.

    [Number] [varchar](15) NOT NULL

    [Person_ID] [varchar](12) NULL

    Here is the query we are doing:

    Select Number,Person_ID From TableName where LP='ABC123'

    The result I get back is the following:

    Number:1

    Person_ID:13864

    The Person_ID should be a result of another table that created that Person_ID but it doesn't exist in that table. So we do not know where that 13864 is coming from. When we open that record through our application it shows Nothing for the Person_ID in that field.

    When we do this query on our copy we get back

    Number:1

    Person_ID:

    Which is exactly what we should see as the result.

    Could there be a sql server setting that is set on their server that could possibly be given us back 13864 for a NULL value?

  • Script out your table.

    Maybe the table name exists twice, one in its own schema.

    Maybe you are querying a view of the table.

    So, script out the table with schema names, script out the insert for the data you are trying to retrieve.

    Script out the select in its entirety that you use, including schema name.

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • This ended up being bad data that someone on the customer side inserted into the table by mistake.

    Thanks

  • If Edward has are read it accounts men are due out the username and I just be contacted on there I tyro respond at one in not so timely matters truth Jan that's probably the best two ways to contact your find out more about either read it or just examine itself great okay.

    Garcinia Forte[/url]

    well thank you very much for joining us tonight and I was very interesting information I’ll definitely be listening to this song on this interview at another time is round two to go through everything on and I courage Iran also watching to check out of them to calm and I get all the Curtis Frank if you have any questions thank .

    For more information please contact us at --> > >> > > > http://www.optimalstackfacts.org/garcinia-forte/

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

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