Consider the following (Semi-psuedocode):
CREATE TABLE foobar (
id INT NOT NULL
message VARCHAR(40) NOT NULL
)
INSERT INTO foobar (1, "hello");
INSERT INTO foobar (2, "world");
my $resultset = "SELECT * FROM foobar";
while(!$resultset->EOF) {
"UPDATE foobar SET message='blah' WHERE id = ".$resultset->id;
$resultset->moveNext;
}
In essence, I am trying to select all records from a table, and then loop over each one updating a few fields. However, when I do this, I get the following error:
[Microsoft][SQL Server Native Client 10.0][SQL Server]A trigger returned a resultset and/or was running with SET NOCOUNT OFF while another outstanding result set was active. (SQL-42000) at continuous.pl line 493.
The problem is that I am not running any triggers. I thought that maybe this was because I am trying to update an active result set, so I added the intermediary step of selecting all the data into a temp table, and then iterating over the temp table to update the original one, but I still get the same error.
Any ideas what is going on?