[SQL Server] 循环游标执行-无事务
2023-09-27 14:24:39 时间
From: https://blog.csdn.net/weixin_42609389/article/details/126955029
begin declare @a int declare @temp varchar(50) set @a=1 declare order_cursor cursor for (select [CMID] from [Warehouse].[MT].[Customers]) open order_cursor fetch next from order_cursor into @temp while @@FETCH_STATUS = 0 begin update [Warehouse].[MT].[Customers] set CMCode=@a where [CMID]=@temp set @a=@a+1 fetch next from order_cursor into @temp end close order_cursor deallocate order_cursor end go
相关文章
- SQL Server索引 - 聚集索引、非聚集索引、非聚集唯一索引
- Sql server在另一台服务器,在Visual Studio 中没问题,IIS中 提示“在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。。。。”
- 解决开启SQL Server sql Always on Group 事务日志增大的问题
- 在做httpModules测试的时候出现“HTTP Error 500.22 - Internal Server Error 检测到在集成的托管管道模式下不适用的 ASP.NET 设置。”
- SQL Server中的Replicate函数。循环字符次数,可用于多层分类
- 《PowerShell V3——SQL Server 2012数据库自动化运维权威指南》——1.4 浏览SQL Server PowerShell层次结构
- 基于C#+SQL Server(WinForm)学生选课及成绩查询管理系统【100010027】
- Ubuntu16.04 server 安装tensorflow object detection模块
- sql server 小技巧(6) Cannot resolve the collation conflict between "Latin1_General_CI_AI" and "Chinese_PRC_CI_AS" in the equal to operation
- SQL Server索引进阶第五篇:索引包含列 .
- Windows Server 2016搭建Bitlocker驱动器加密
- [Golang] 从零開始写Socket Server(2): 自己定义通讯协议
- 我的Windows Server认证状态究竟是?
- SQL SERVER CHARINDEX功能
- sql server字符串中怎么添加换行?
- 重装windows之后mysql及nfs server的恢复
- 如何在 CentOS 7 上安装 Percona Server
- SQL Server中将多行数据拼接为一行数据(一个字符串)
- 在sql server中循环语句
- sql server中的while循环语句