Query Analyser returns 13 rows - MSStoredProc returns 10 rows - is it possible?

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
B4rT
Posts: 6
Joined: Mon 17 Jan 2005 11:41
Contact:

Query Analyser returns 13 rows - MSStoredProc returns 10 rows - is it possible?

Post by B4rT » Thu 24 Feb 2005 11:42

First of all is the question: can I use MSStoredProc component to execute stored procedures that returns data set (or mayby only for executing stored procedures on the server, that is for stored procedures that not returns data sets)?

In my aplpication I'm using MSStoredProc component.
When I'm executing stored procedure (that returns SELECT FROM @Table) by using MSStoredProc component, the result set has 10 rows (RecordCount = 10), where the stored procedure returns 13 rows (I intercepted execution in the SQL Server Profiler, copied the "TextData" of intercepted execution of stored procedure and executed it in the Query Analyser where execution returns 13 rows).
Is this possible? How and why?
(btw: now, overnight everything is OK - after execution with MSStoredProc component, result set has 13 rows (correctly), but I must unravel it because I don't know IF the problem do not ocuurs selfsame again in the future)

Second question (mayby trivial, but essential): how should look correct use of MSStoredProc? I mean, how it should look in Delphi: if I must use prepare, unprepare, open, execute or something else, before or after executing/opening stored procedure with MSStoredProc? (maybe I'm doing something wrong)

I'm using SDAC 3.00.2.9 23.11.04

Thanks for answer.

B4rT

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 25 Feb 2005 09:55

> can I use MSStoredProc component to execute stored procedures that returns
> data set (or mayby only for executing stored procedures on the server, that is
> for stored procedures that not returns data sets)?

Yes, you can.

> Is this possible? How and why?

Is it possible that any parameters were set in different? Or procedures were
performed in different transactions or with different IsolationLevel?

If you could reproduce the problem, please send us complete small sample
to demonstrate it and include a script to create and fill SP and tables.

> how should look correct use of MSStoredProc

Working with StoredProc a little differs from working with common TMSQuery.
At common case, it is enough to set StoredProcname, parameters and execute Execute
method.

Post Reply