Colin
Colin

Reputation: 855

SSMS returning only partial results

This was a very bizarre scenario I just witnessed on a colleague's machine.

While issuing an update statement in SSMS, we noticed that the message returned indicated a single record was updated. When querying the same table for all records, SQL returned only a single result, which did not match the where clause of the previous update statement. We were able to reproduce this phenomenon several times with no change.

We then opened a new query tab, and performed the exact same (copy&paste) select * query, and in this window, 18 records were returned including the record matching the where clause of our update statement.

Returning to the first tab and running select * still only resulted in a single record. We tried reconnecting to out SQL instance in that tab, and were then able to return the full 18 results.

What happened? It seems as though SSMS had some kind of error, but the fact that we were able to update and select (one) record in the "broken" tab is very puzzling. Has anyone seen anything like this before?

Upvotes: 0

Views: 480

Answers (1)

Callie J
Callie J

Reputation: 31316

Had someone issued SET ROWCOUNT 1 previously in that window? What you're describing sounds exactly like this.

The effects of changing rowcount can be switched off with SET ROWCOUNT 0.

More details of this option over in MSDN.

Upvotes: 2

Related Questions