Home > Database > Mysql Tutorial > sqlserver 游标的简单示例

sqlserver 游标的简单示例

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:57:42
Original
822 people have browsed it

比较简单的例子,学习sqlserver游标

Declare @Id varchar(20)
Declare @Name varchar(20)
Declare Cur Cursor For
select substring(id,0,7) as id,name from temp1
Open Cur
Fetch next From Cur Into @Id,@Name
While @@fetch_status=0
Begin
Update temp Set [c3]=@Name where [id] like @Id+'%'
Fetch Next From Cur Into @Id,@Name
End
Close Cur
Deallocate Cur
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Problem with tp6 connecting to sqlserver database
From 1970-01-01 08:00:00
0
0
0
Unable to connect to SQL Server in Laravel
From 1970-01-01 08:00:00
0
0
0
Methods of parsing MYD, MYI, and FRM files
From 1970-01-01 08:00:00
0
0
0
SQLSTATE: User login failed
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template