I have a recordset-returning DataEnvironment command thats source is a stored procedure. The stored procedure looks something like this:
CREATE PROCEDURE sproc1 @var1 varchar(6) AS
<SELECT statement 1>
if @@rowcount = 1 return else
begin
<SELECT statement 2>
if @@rowcount > 0 return
end
end
The problem is when I execute the datacommand:
de.sproc1 "paramater1"
the resulting recordset (de.rssproc1) is that of the first SELECT statement, but what I want is the second SELECT statement (because @@rowcount was not equal to 1). Does that make sense? Is there a way to make the recordset hold the results of the last SELECT statement that was executed instead of the first?
CREATE PROCEDURE sproc1 @var1 varchar(6) AS
<SELECT statement 1>
if @@rowcount = 1 return else
begin
<SELECT statement 2>
if @@rowcount > 0 return
end
end
The problem is when I execute the datacommand:
de.sproc1 "paramater1"
the resulting recordset (de.rssproc1) is that of the first SELECT statement, but what I want is the second SELECT statement (because @@rowcount was not equal to 1). Does that make sense? Is there a way to make the recordset hold the results of the last SELECT statement that was executed instead of the first?