Same query gives different number of records

  • Hi,

    i am just trying to run the open query on the linked server which gives different number of records each time i run. Is it to do with time out? it doesnt give any error about time out and just runs fine but it gives different records. The table in the linked server is not updated continuesly so i wont expect the record to be changed.

    any thoughts?

    thanks.

  • Hard to know without seeing the query and knowing something about the data. Assuming no changes to the data and a well structured query, you should see the same data every time you run the query. A timeout should generate some sort of error or response.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • DVA, I assume you're not reading dirty data as you stated changes are infrequent but check your isolation level.

    That said, are you connecting to another SQL Server or a different RDBMS (Oracle, Access, etc.)? And what provider are you using (ODBC, OLE, etc.)? Could be an issue with provider's library drivers.

    Please provide some additional information so we can help narrow this down.

    thanks,

    --tz

  • I am also facing the same problem while querying through linked server of SYBASE ASE OLEDB PROVIDER. I have just use simple join query.

    हेमडब्या

  • hemdbya (11/1/2011)


    I am also facing the same problem while querying through linked server of SYBASE ASE OLEDB PROVIDER. I have just use simple join query.

    I have used the Sybase ASA / SQL Anywhere provider before on OLEDB and ADO.NET and the drivers default is READ UNCOMMITTED so you get dirty reads, I am sure this is the same for the ASE provider as well. Best checking with Sybase support if you have a support contract.

    You can set a flag in the DSN to change the default behavour of the connection to READ COMMITTED or another isolation level.

  • There is no such option available in DSN for SYABASE ASE ODBC driver 4.20.00.15

    हेमडब्या

  • I no longer work in the company where I used Sybase so I cant find the setting in the DSN for you, but I know it wasnt something which said READ UNCOMMITTED etc, you had to put a number in a box which relates the the isolation level you want.

    Version 4 of the driver seems a bit old, ASE is up to version 15 so I would recommend getting a newer version of the driver

  • Thanks buddy,

    I have already installed both 'SQL ANYWHERE OLEDB Driver' and 'SYBASE ASE ODBC Driver' as we have 64bit environment for SQL Server 2008. So i am able to see the option <set transaction isolation level> in SQL ANYWHERE OLEDB Driver but we are not using that, to create the linked server to sybase because of some limitations.

    i think i should consult with sybase support people.

    हेमडब्या

  • what is your Sybase database running on ASE or ASA(SQLAnywhere), as you cant cross the two drivers over on to different platforms as we have been told by Sybase support before.

  • dva2007 (10/25/2011)


    Hi,

    i am just trying to run the open query on the linked server which gives different number of records each time i run. Is it to do with time out? it doesnt give any error about time out and just runs fine but it gives different records. The table in the linked server is not updated continuesly so i wont expect the record to be changed.

    any thoughts?

    thanks.

    Please post your query to start. Also, if you can, the DDL of the tables being queried.

    Thanks,

    Jared

    Jared
    CE - Microsoft

Viewing 10 posts - 1 through 9 (of 9 total)

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