Insert not working into SQL 2005 database with SQL Native Client

  • I have a SQL Server 2000 database that I backed up and restored onto SQL 2005 with no problems.  There are 2 applications that access this database through ODBC connections.  I created a SQL Native Client connection to the database that appears to work fine.  One application reads data from the database into a dataset for various calculations.  This app works fine.  The other application inserts data into the database and that's the part that is not working.  When I copy the SQL script for the insert statement and use it in a manual query on the 2005 database it works fine - data is inserted into the table.   However, when the application runs in debug mode, it appears to insert the data (no errors occur) but the data does not actually enter the table, so later in the program when the app goes to use the data it fails.  Running using a SQL Native Client ODBC connection to the 2000 database fails in the same way.  However running using a SQL Server ODBC connection to the 2000 database works fine.  Any thoughts on what could be happening here?  Thanks!

  • My first thought is:  are you sure the app is connected to the SQL 2005 machine? Perhaps it is using the old connection info or cached connection info and is inserting to the old SQL 2000 server.

    What is the insert command?

    Can you execute an ad hoc query from the app? If so, have it execute:  Select @@ServerName

    Are there insert triggers or replication on the table that might be rolling back the transaction after the data is inserted.


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

Viewing 2 posts - 1 through 2 (of 2 total)

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