45fan.com - 路饭网
首页
路由器设置
无线路由器
路由器密码
网络频道
手机频道
电脑频道
图库频道
问答中心
搜索:
智能搜索
搜索标题
您的位置
:
主页
>
电脑频道
>
电脑教程
> 阅读资讯:sql server 2000存储过程的类型介绍
sql server 2000存储过程的类型介绍
2016-09-03 11:38:44 来源:www.45fan.com 【
大
中
小
】
sql server 2000存储过程的类型介绍
create
table
test(id
int
primary
key
,name
char
(
10
))
insert
into
test
values
(
1
,
'
test1
'
)
insert
into
test
values
(
2
,
'
test2
'
)
insert
into
test
values
(
3
,
'
test3
'
)
insert
into
test
values
(
4
,
'
test4
'
)
1
、返回结果集
create
procedure
return_result
as
select
*
from
test
exec
return_result
--
调用
--
idname
--
1test1
--
2test2
--
3test3
--
4test4
2
、输入参数和输出参数
create
procedure
input_output
@id
int
,
@name
char
(
10
)output
as
begin
select
@name
=
name
from
test
where
id
=
@id
end
--
调用
declare
@name
char
(
10
)
exec
input_output
1
,
@name
output
select
@name
name
--
输出结果
--
name
--
test1
3
、返回值
--
每个存储过程都可以以一个return语句返回一个整型(integer)的值
alter
procedure
return_value
@id
int
as
begin
declare
@count
int
--
只能返回整型的值
select
@count
=
count
(
*
)
from
test
where
id
=
@id
return
@count
end
--
调用
declare
@count
char
(
10
)
exec
@count
=
return_value
1
select
@count
shuliang
--
结构
--
shuliang
--
1
本文地址:
http://www.45fan.com/dnjc/71670.html
Tags:
sql
Server
2000
编辑:路饭网
上一篇:
线程基本概念介绍
下一篇:
解决服务器未能转入应用程序的方法
相关文章列表
在64位win10系统安装绿色版mysql-5.7.16-
小米20000mAh新移动电源价格如何?
安装配置mysql压缩包版的步骤
安装sql server 2012的方法技巧
如何实现在windows10上安装mysql?
给联想小新V2000 UEFI笔记本设置BIOS的步
解决电脑经常遇到加载dll时提示DllRegist
如何通过MyEclipse连接MySQL数据库?
Myeclipse如何连接mysql数据库?
myeclipse中连接mysql数据库示例代码的详
推广内容
推荐阅读
热门推荐
推荐文章
·
如何为Excel2010表格中的图表添加说明文
·
Win7系统看电影时,如果有QQ消息,电影声
·
WPS文字文档中,如何给指定的文字添加边
·
盘点制作PPT时常用的一些快捷键大全
·
分享一组Win8系统不太为人所知的小技巧
·
系统遇到特殊故障时,如何进入Win10系统
·
电脑系统损坏要如何修复?修复win10系统
·
想找回关闭的网页该怎么办?怎样查看360
·
实现电脑每天定时关机,借助Win7任务计划
·
什么是Telnet协议?Win7如何开启Telnet服
·
电脑时间出现差错时如何进行北京时间校准
·
电脑运行速度慢,C盘空间越来越小,如何
关于我们
|
联系我们
|
友情链接
|
网站地图
|
Sitemap
|
App
|
返回顶部