08-23-12, 19:37 #1Registered User
- Join Date
- Aug 2012
Unanswered: SP Executed successfully in SSMS but fail in C++/ODBC
I have an app that run from multiple computers and must synchronize something between its internal database and one database from SQL server.
I use some temporary tables to insert internal database's data and then call an SP to synchronize data, it will process data row-by-row and then either update them in SQL database, insert new rows or delete dropped rows. Since I should support customers that have SQL server 2000, I should have a solution other than MERGE.
The problem is my SP work very well in SSMS but it suddenly fail when called from my application, I use C++ native code and use ODBC and SQL Native Client for connection with SQL server.
I have attached my database creation commands and a simple test case.
Each time that I execute #SynchronizeP from C++ app I get a sudden error somewhere in between the SP and transaction will be failed, but executing the code in SSMS is perfect. I tried anything but I can't come up with an answer!!
08-27-12, 17:01 #2Registered User
- Join Date
- Jul 2003
- San Antonio, TX
I think you're misusing temporary objects. They only exist for the duration of the connection that created them. Once the connection is severed, - they become inaccessible and get cleaned up by the server."The data in a record depends on the Key to the record, the Whole Key, and
nothing but the Key, so help me Codd."