当前位置:网站首页>SQL Server cursor circular table data
SQL Server cursor circular table data
2022-04-23 10:29:00 【---Pure heart and few desires---】
Realization function , Using cursor to cycle table data , And print it out
Table data content

The idea of realization

Implementation code :
declare @id nvarchar(200)
declare @name nvarchar(150)
declare @parentid nvarchar(200)
declare data cursor for
select id,name,parentid from sys_org
open data
fetch next from data into @id, @name, @parentid
while (@@fetch_status = 0)
begin
-- Statements that need to be executed
print 'id:'+@id
+' name:'+@name
+' parentid:'+ @parentid
fetch next from data into @id, @name, @parentid
end
close data
deallocate data
Execution effect

版权声明
本文为[---Pure heart and few desires---]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231024447091.html
边栏推荐
- 1. Sum of two numbers (hash table)
- Ansible playbook syntax and format automate cloud computing
- MapReduce core and foundation demo
- 203. Remove linked list elements (linked list)
- Detailed explanation of MapReduce calculation process
- [provincial election joint examination 2022 d2t1] card (state compression DP, FWT convolution)
- Yarn resource scheduler
- 【无标题】
- Arbitrary file reading vulnerability exploitation Guide
- Example of pop-up task progress bar function based on pyqt5
猜你喜欢
随机推荐
[untitled]
JUC concurrent programming 06 -- in-depth analysis of AQS source code of queue synchronizer
Introduction to wechat applet, development history, advantages of applet, application account, development tools, initial knowledge of wxml file and wxss file
202. Happy number
LeetCode-608. 树节点
Realizing data value through streaming data integration (5) - flow analysis
通过流式数据集成实现数据价值(5)- 流分析
19、删除链表的倒数第N个节点(链表)
Sim Api User Guide(8)
一文看懂 LSTM(Long Short-Term Memory)
Swagger2 自定义参数注解如何不显示
Exercise questions and simulation test of refrigeration and air conditioning equipment operation test in 2022
Linked list intersection (linked list)
206. Reverse linked list (linked list)
Chapter 1 Oracle database in memory related concepts (im-1.1)
What about Jerry's stack overflow? [chapter]
域名和IP地址的联系
基于PyQt5实现弹出任务进度条功能示例
202、快乐数
MySql常用语句








![[untitled]](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)