Home  >  Article  >  Database  >  SQL 必知必会笔记19使用游标

SQL 必知必会笔记19使用游标

WBOY
WBOYOriginal
2016-06-07 17:38:371020browse

游标(cursor)是一个存储在DBMS服务器上的数据库查询,它不是一条SELECT语句,而是被该语句检索出来的结果集。在存储了游标之后,应用程序可以根据需要滚动或浏览其中的数据。 使用游标 使用游标的步骤: 1. 创建游标 在SQL Server中使用DECLARE命名游标,

游标(cursor)是一个存储在DBMS服务器上的数据库查询,它不是一条SELECT语句,而是被该语句检索出来的结果集。在存储了游标之后,,应用程序可以根据需要滚动或浏览其中的数据。

使用游标

使用游标的步骤:

 

1. 创建游标

在SQL Server中使用DECLARE命名游标,并定义相应的SELECT语句,根据需要带WHERE和其他子句,示例如下:

Customers

Statement:
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