SQL Server Cursor Reference (Syntax, etc)

房东的猫 提交于 2019-11-27 07:58:38

问题


I don't use SQL Server Cursors often but when I do, I always have to look up the syntax and options.

So I wanted to ask, what is the best SQL Server Cursor reference on the web?.

I'm looking for a reference that explains all of the (major?) options (I.E. FAST_FORWARD) and also shows quick snippets of how to use it. (I.E. How to implement looping though a cursor and with a good practice for checking the @@FETCH_STATUS variable.)

Best Regards,
Frank

Quick Update: I'm looking for a balance of quick-reference but detailed enough to see my options. As an example. MSDN is a great reference guide but it has too much detail. The reference, ideally, should be concise.

Further update: I'm still looking for sources. If someone posts a good source that fits my criteria of concise, I will accept that answer...


回答1:


I'd start out with the MSDN help page for cursors...

http://msdn.microsoft.com/en-us/library/ms180169.aspx




回答2:


How to Perform SQL Server Row-by-Row Operations Without Cursors:
http://www.sql-server-performance.com/articles/per/operations_no_cursors_p1.aspx

SQL Server Cursor Examples (with Cursor Alternatives):
http://www.mssqltips.com/tip.asp?tip=1599




回答3:


I always use the built in "Transact-SQL Reference" help within management studio. I find the examples on everything there to be more than enough for what I need.



来源:https://stackoverflow.com/questions/935336/sql-server-cursor-reference-syntax-etc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!