Monday, 24 January 2005

SQL Server - when STATIC is DYNAMIC

My head hurts... according to MSDN documentation on CURSORS:

“Forward-only: The rows are not retrieved from the database until they are fetched”

“Static: The complete result set of a static cursor is built in tempdb when the cursor is opened”

which seems mutually exclusive, but

“SQL Server considers both forward-only and scroll as options that can be applied to static, keyset-driven, and dynamic cursors.”

and finally

“When a database API cursor attribute or property is set to forward-only, SQL Server implements this as a forward-only dynamic cursor.”

so specifying STATIC FORWARD ONLY gets implemented as DYNAMIC FORWARD_ONLY (no tempdb)
and STATIC alone gets the tempdb copy you’re (presumably) after…

Forward-only Cursors

Static Cursors

No comments:

Post a Comment

Note: only a member of this blog may post a comment.