D
Doug
I would like to pass the following commands to SQL 2005 using ADO.NET
SQLCommand in VS2005:
SELECT * FROM Table1 WHERE Column1 = 'SomeValue';
SELECT * FROM Table2;
UPDATE Table1 SET Column1 = 'something' WHERE Column2 = 'SomeOtherValue';
UPDATE Table2 SET Column1 = 1234 WHERE Column2 = 'YetAnotherValue'
etc...
I get back the result sets OK but what I am having trouble finding is how
many rows were affected by each individual UPDATE statement.
I know I can add @@ROWCOUNT to the script above but the commands are entered
in an interface similiar to Mgmt Studio and would like to display something
like the Messages tab in Mgmt Studio. The commands are passed to a remote
SQL Server instance, executed, and the results are returned via a web service.
It seems like the SqlDataReader.RecordsAffected property will give me a
count of rows affected, but it is a sum of all UPDATE (or DELETE) statements
that executed for the whole script. So I would have to divide out the
separate commands and execute them separately to use that method. I am
wondering if there is another way...
TIA!
SQLCommand in VS2005:
SELECT * FROM Table1 WHERE Column1 = 'SomeValue';
SELECT * FROM Table2;
UPDATE Table1 SET Column1 = 'something' WHERE Column2 = 'SomeOtherValue';
UPDATE Table2 SET Column1 = 1234 WHERE Column2 = 'YetAnotherValue'
etc...
I get back the result sets OK but what I am having trouble finding is how
many rows were affected by each individual UPDATE statement.
I know I can add @@ROWCOUNT to the script above but the commands are entered
in an interface similiar to Mgmt Studio and would like to display something
like the Messages tab in Mgmt Studio. The commands are passed to a remote
SQL Server instance, executed, and the results are returned via a web service.
It seems like the SqlDataReader.RecordsAffected property will give me a
count of rows affected, but it is a sum of all UPDATE (or DELETE) statements
that executed for the whole script. So I would have to divide out the
separate commands and execute them separately to use that method. I am
wondering if there is another way...
TIA!