return into

林g 2009-04-25 11:02:34
在存储过程中怎么去用return into语句
存储过程的功能是关于数据添加的返回其ID,ID为自动编号,
我不知道怎么去运用return into 的语句构造
...全文
152 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
you_tube 2009-04-25
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 jlingang 的回复:]
我是用C#编程,怎么接收不了他的返回值呢?
[/Quote]
代码没写好吧
林g 2009-04-25
  • 打赏
  • 举报
回复
我是用C#编程,怎么接收不了他的返回值呢?
csdyyr 2009-04-25
  • 打赏
  • 举报
回复
create table tb(id int identity(1,1), col int)
go

create proc test
as
insert tb select 1
return @@IDENTITY
go

declare @id int
exec @id=test
select @id


drop table tb
drop proc test
liangCK 2009-04-25
  • 打赏
  • 举报
回复
.......

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧