Title: [Order 08][P3] Remove SQL Server SET ROWCOUNT paging · Issue #65 · NEventStore/NEventStore.Persistence.SQL · GitHub
Open Graph Title: [Order 08][P3] Remove SQL Server SET ROWCOUNT paging · Issue #65 · NEventStore/NEventStore.Persistence.SQL
X Title: [Order 08][P3] Remove SQL Server SET ROWCOUNT paging · Issue #65 · NEventStore/NEventStore.Persistence.SQL
Description: Priority order Order: 08 of 09 Priority: P3 correctness/performance Problem SQL Server dialect uses session-scoped SET ROWCOUNT for snapshot reads and natural paging. Evidence: src/NEventStore.Persistence.Sql/SqlDialects/MsSqlDialect.cs:...
Open Graph Description: Priority order Order: 08 of 09 Priority: P3 correctness/performance Problem SQL Server dialect uses session-scoped SET ROWCOUNT for snapshot reads and natural paging. Evidence: src/NEventStore.Pers...
X Description: Priority order Order: 08 of 09 Priority: P3 correctness/performance Problem SQL Server dialect uses session-scoped SET ROWCOUNT for snapshot reads and natural paging. Evidence: src/NEventStore.Pers...
Opengraph URL: https://github.com/NEventStore/NEventStore.Persistence.SQL/issues/65
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Order 08][P3] Remove SQL Server SET ROWCOUNT paging","articleBody":"## Priority order\n\nOrder: 08 of 09\nPriority: P3 correctness/performance\n\n## Problem\n\nSQL Server dialect uses session-scoped `SET ROWCOUNT` for snapshot reads and natural paging.\n\nEvidence:\n\n- `src/NEventStore.Persistence.Sql/SqlDialects/MsSqlDialect.cs:21`\n- `GetSnapshot` prepends `SET ROWCOUNT 1`.\n- `NaturalPaging` uses `SET ROWCOUNT @Limit`.\n\n## Impact\n\n- `SET ROWCOUNT` is session-scoped and easy to misuse.\n- Snapshot reads can use explicit `TOP (1)` instead.\n- Natural paging can use explicit `TOP (@Limit)` or keyset query shapes.\n\n## Mandatory test-first workflow\n\n- Add tests first that verify SQL Server snapshot and natural-paging behavior.\n- Include `GetSnapshot` coverage.\n- Include `GetStreamsToSnapshot` coverage with more rows than page size.\n- Do not change SQL generation until behavior is covered.\n\n## Proposed action\n\n- Replace snapshot query with `SELECT TOP (1) ... ORDER BY StreamRevision DESC`.\n- Replace natural paging with explicit `TOP (@Limit)` query forms or keyset-compatible SQL.\n\n## Acceptance criteria\n\n- SQL Server integration tests pass.\n- No rowcount setting can affect later commands on the same connection.\n- Existing paging behavior remains ordered and complete.\n\nSource: `docs/Project-Analysis-Issue-Drafts.md`.","author":{"url":"https://github.com/AGiorgetti","@type":"Person","name":"AGiorgetti"},"datePublished":"2026-06-11T09:21:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/65/NEventStore.Persistence.SQL/issues/65"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c1df9c1b-9485-6583-b253-d16d017aecf1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DC10:29330:B1D8AF:B5D3D1:6A4DB717 |
| html-safe-nonce | 19c4dd3c1a992117098816bdc29fc053ff3f5e4e02b0c2183785832139ee6216 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzEwOjI5MzMwOkIxRDhBRjpCNUQzRDE6NkE0REI3MTciLCJ2aXNpdG9yX2lkIjoiNDIzMDUxMDYzNjIxODMwMDE4NCIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9 |
| visitor-hmac | 6999e487611b3ec6f6419e384e34f1607e27a632269d44bd20a67ecf6815a4d0 |
| hovercard-subject-tag | issue:4639070279 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NEventStore/NEventStore.Persistence.SQL/65/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7e11967da968907f812a6e7dbc9d18232e3078d68ea6f63d3bcb9126f06bc67e/NEventStore/NEventStore.Persistence.SQL/issues/65 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7e11967da968907f812a6e7dbc9d18232e3078d68ea6f63d3bcb9126f06bc67e/NEventStore/NEventStore.Persistence.SQL/issues/65 |
| og:image:alt | Priority order Order: 08 of 09 Priority: P3 correctness/performance Problem SQL Server dialect uses session-scoped SET ROWCOUNT for snapshot reads and natural paging. Evidence: src/NEventStore.Pers... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AGiorgetti |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/NEventStore/NEventStore.Persistence.SQL git https://github.com/NEventStore/NEventStore.Persistence.SQL.git |
| octolytics-dimension-user_id | 4486767 |
| octolytics-dimension-user_login | NEventStore |
| octolytics-dimension-repository_id | 36130556 |
| octolytics-dimension-repository_nwo | NEventStore/NEventStore.Persistence.SQL |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36130556 |
| octolytics-dimension-repository_network_root_nwo | NEventStore/NEventStore.Persistence.SQL |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 32f7b614aca06e6bbd89842b1370df1328264f68 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width