当前位置:网站首页>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
边栏推荐
- 任意文件读取漏洞 利用指南
- Read LSTM (long short term memory)
- Jinglianwen technology - professional data annotation company and intelligent data annotation platform
- 域名和IP地址的联系
- Sim Api User Guide(7)
- Reading integrity monitoring techniques for vision navigation systems - 3 background
- SQLServer 查询数据库死锁
- Using idea to develop Spark Program
- Jerry's users how to handle events in the simplest way [chapter]
- DBA常用SQL语句 (5) - Latch 相关
猜你喜欢
Detailed explanation of MapReduce calculation process
Juc并发编程07——公平锁真的公平吗(源码剖析)
Reading integrity monitoring techniques for vision navigation systems - 3 background
0704、ansible----01
Example of pop-up task progress bar function based on pyqt5
Charles 功能介绍和使用教程
2022 mobile crane driver test question bank simulation test platform operation
Xshell+Xftp 下载安装步骤
得到知识服务app原型设计比较与实践
mysql同一个表中相同数据怎么合并
随机推荐
Realize data value through streaming data integration (1)
JVM——》常用参数
Jerry sometimes finds that the memory has been tampered with, but there is no exception. How should he find it? [chapter]
Jerry's users how to handle events in the simplest way [chapter]
使用IDEA开发Spark程序
209. Subarray with the smallest length (array)
Define linked list (linked list)
0704、ansible----01
mysql同一个表中相同数据怎么合并
【无标题】
Chapter I Oracle database in memory related concepts (Continued) (im-1.2)
Jerry's factors that usually affect CPU performance test results are: [article]
Example of pop-up task progress bar function based on pyqt5
997、有序数组的平方(数组)
精彩回顾 | DEEPNOVA x Iceberg Meetup Online《基于Iceberg打造实时数据湖》
Yarn core parameter configuration
Operation of 2022 tea artist (primary) test question simulation test platform
SSH uses private key to connect to server without key
Sim Api User Guide(5)
Sim Api User Guide(7)