SQL 数据库中的存储过程的参数有关问题

SQL 数据库中的存储过程的参数问题
怎么将SQL数据库中的存储过程中的参数既作为输出变量又作为输出变量?
  
  感谢高手指导!
  
    
SQL 数据库中的存储过程中的参数问题

------解决方案--------------------
不行的,多定义参数而已,最后输出变量=输入变量即可
------解决方案--------------------
引用:
怎么将SQL数据库中的存储过程中的参数既作为输出变量又作为输出变量?
  
  感谢高手指导!
  
    


可以的哈,我给你做了一个实验,你看看,是这样不:

--drop proc proc_test
--go


create proc dbo.proc_test
@in int,
@out int out,
@in_out int output
as

select @out = @in + @in_out,  --1 + 2 = 3
       @in_out = @out + 1     --3 + 1 = 4
go


declare @in_p int
declare @out_p int
declare @in_out_p int

set @in_p = 1;
set @in_out_p = 2

exec dbo.proc_test @in_p,
                   @out_p out,
                   @in_out_p output
                   

select @in_p,    --输入参数
       @out_p,   --输出参数
       @in_out_p --输入,输出参数
/*
(无列名) (无列名) (无列名)
1 3 4
*/       
       

------解决方案--------------------
需要注意的是,在定义存储过程的参数时,out的表是输出参数,output是输入输出参数。
------解决方案--------------------
输入输出参数用output,C#程序在调用存储过程时,可以设置参数的属性,有一个inputandoutput的属性。