首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

sql存储过程有关问题(高手帮忙)

2012-01-15 
sql存储过程问题(高手帮忙)create proc hehe @a int output asset @a10select title from announces wher

sql存储过程问题(高手帮忙)
create proc hehe @a int output as
set @a=10
select title from announces where id=@@a
return 5

declare @a int
set @a=5
exec hehe @a
select @a

不知道为什么@a的值不改变,请高手指点,想将存储过程中
的@a返回,并输出

[解决办法]
create proc hehe @a int output as 
--set @a=10 --你这里一直给参数赋值,外面传进来的也都被你改变了,把这里注释掉就可以了
select title from announces where id=@@a 
return 5 

[解决办法]
一开始就设置了,你要怎么改变?set @a=10

热点排行
Bad Request.