problem with SQL Server 2005 sp called from VC++ 6.0

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Dear all -

We run into a very strange problem. We have a very large & complex SQL
Server 2005 stored procedure with a number of temp tables and
cursors.

The logic in this sp is written as such - it truncates a permanent
table in the database, inserts 360 rows into it, than executes the
logic and updates all columns and rows (using cursors from temp
tables) in this table.

When we run it within SQL Server Management Studio - basically doing
"exec sp_xxx" it works just fine. When we're trying to run the same sp
from VC++ (ultimately using SQLExecDirect call) strange things are
happening. Permanent table that is used to hold results gets
truncated, rows are inserted, temp tables are created and populated,
but than SQL Server literally 'ignores' all updates that are sitting
inside cursors. After that sp returns with no error code!

Any ideas or similar experience anyone?

Any help is greatly appreciated.
.



Relevant Pages

  • SQL Server 2005 - stored proc w/temp tables & cursors works from Management Studio, but fail
    ... We have a very large & complex SQL ... logic and updates all columns and rows (using cursors from temp ... When we run it within SQL Server Management Studio - basically doing ...
    (microsoft.public.vc.database)
  • problem with SQL Server 2005 sp called from VC++ 6.0
    ... We have a very large & complex SQL ... logic and updates all columns and rows (using cursors from temp ... When we run it within SQL Server Management Studio - basically doing ...
    (microsoft.public.vc.mfc)
  • Importing text file
    ... The a temp table is created and the textfile is imported ... I read some stuff about DTS packages but I'm not real familiar with SQL ... Server and don't know how exactly to call the DTS package from my ...
    (microsoft.public.vsnet.general)
  • Re: SQL/OLEDB/JET
    ... > when attempting to read/write to Excel from within SQL ... > Server (e.g. using the OpenRowset command, ... > that the TEMP variable is set correctly. ... The SQL Server service emulates the authority of the user authenticating ...
    (microsoft.public.sqlserver.programming)
  • Re: A lot of sp_cursorfetch in profiler.
    ... DB, ODBC, ADO, and DB-Library APIs which map cursors over the result sets of ... A quick search on SQL Server ... Cursors" ... ...
    (microsoft.public.sqlserver.programming)