You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cursors gain variables, true scoping, concurrency semantics, and the sp_cursor* API-server-cursor RPC family: DECLARE @c CURSOR / SET-binding shares refcounted cursor objects with position, CURSOR VARYING OUTPUT params survive into the caller, GLOBAL/LOCAL become distinct scopes with LOCAL-first resolution and the scope-aware CURSOR_STATUS matrix, SCROLL_LOCKS holds a U row lock across autocommit until scroll-away/close, OPTIMISTIC positioned DML raises 16947/16934/3621 chain, FOR UPDATE OF enforces Msg 16932 and TYPE_WARNING emits Msg 16956; over TDS, procids 1-9 dispatch to handlers that reuse the engine cursors end-to-end, mirroring the probed wire contract. Trailing ROWSTAT column, metadata-only open, INPUT-only fetch positioning, scrollopt/ccopt downgrade OUT values, rowcount -1 for dynamic, and real's own non-surfacing of optimistic conflicts through sp_cursor.
Copy file name to clipboardExpand all lines: CLAUDE.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,7 +130,7 @@ Per-feature deep-dives live under `docs/claude/`. Each entry below is a trigger:
130
130
-**`PIVOT` / `UNPIVOT`** — PIVOT desugars to grouped conditional aggregation (implicit grouping = inner columns minus FOR + aggregate-arg), UNPIVOT is a NULL-skipping unfold; both attach as a postfix FROM-source wrapper on the derived-table `LateralPlan` seam → [`pivot.md`](docs/claude/pivot.md).
-**BACPAC import** (`Simulation.ImportBacpac` — multi-database via repeated calls, `BacpacImportOptions`, `ModelXmlReader` dispatcher, BCP wire format, `BacpacBuilder` test harness) → [`bacpac-loader.md`](docs/claude/bacpac-loader.md).
166
166
-**Linked servers** (`Simulation.AddRemoteSimulation`, `sp_addlinkedserver` / `sp_dropserver`, four-part FROM routing through the remote's ADO.NET pipeline, `OPENQUERY(server,'query')` ad-hoc pass-through + compile-time schema discovery, `sys.servers`) → [`linked-servers.md`](docs/claude/linked-servers.md).
167
-
-**TDS network endpoint** (`Simulation.ListenAsync` → `SimulatedNetworkListener`; real SqlClient over loopback TCP+TLS; SQLBatch/RPC/TM, no bulk; credential enforcement via the `CREATE LOGIN` registry, Msg 18456 on mismatch; EF via plain `UseSqlServer`; oracles = `*.Tests.SqlClient` + `*.Tests.Smo`, the real-SMO consumer oracle) → [`tds-endpoint.md`](docs/claude/tds-endpoint.md).
167
+
-**TDS network endpoint** (`Simulation.ListenAsync` → `SimulatedNetworkListener`; real SqlClient over loopback TCP+TLS; SQLBatch/RPC/TM, no bulk; `sp_cursor*` API-server-cursor RPC family; credential enforcement via the `CREATE LOGIN` registry, Msg 18456 on mismatch; EF via plain `UseSqlServer`; oracles = `*.Tests.SqlClient` + `*.Tests.Smo`, the real-SMO consumer oracle) → [`tds-endpoint.md`](docs/claude/tds-endpoint.md).
"No rows were updated or deleted.\nOptimistic concurrency check failed. The row was modified outside of this cursor.\nThe statement has been terminated.",
93
+
newSimulatedError(@class:16,lineNumber:0,"No rows were updated or deleted.",16947,procedure:"",server:"",source:"Core Microsoft SqlClient Data Provider",state:1),
94
+
newSimulatedError(@class:0,lineNumber:0,"Optimistic concurrency check failed. The row was modified outside of this cursor.",16934,procedure:"",server:"",source:"Core Microsoft SqlClient Data Provider",state:1),
95
+
newSimulatedError(@class:0,lineNumber:0,"The statement has been terminated.",3621,procedure:"",server:"",source:"Core Microsoft SqlClient Data Provider",state:0));
96
+
97
+
/// <summary>
98
+
/// Msg 16950: a <c>FETCH</c> (or other cursor operation) named a cursor
99
+
/// <em>variable</em> that has no cursor allocated to it — declared with
100
+
/// <c>DECLARE @c CURSOR</c> but never <c>SET</c>, or referencing a
101
+
/// deallocated cursor. Probe-confirmed verbatim against SQL Server 2025
0 commit comments