Does any one have any idea why I wont get a resultset if I do an update before the select in a store procedure. Im running MSSQL server 2005 and the latest Microsoft JDBC driver.
Relevant java code:
CallableStatement cstmt = con.prepareCall("{call dbo.sp_groups_select}");
if (cstmt.execute()) {
while (cstmt.getResultSet().next())
Does not get a resultset if the store procedure looks like this:
CREATE PROCEDURE [dbo].[sp_groups_select] AS
update Computers set ComputerName='Foo' where ComputerName='bar';
select * from Computers;
But if it looks like this I do get a resultset
CREATE PROCEDURE [dbo].[sp_groups_select] AS
select * from Computers;
update Computers set ComputerName='Foo' where ComputerName='bar';