日期:2014-05-18 浏览次数:20617 次
declare @xm varchar (4),@xh int set @xm='bbbb' exec syxm @xm, @xh output select @xh
------解决方案--------------------
if object_id('sy') is not null drop table sy go create table sy ( xh int identity(1,1), xm varchar(4) ) go if object_id('up_tb') is not null drop procedure up_tb go create procedure up_tb (@xm varchar(4),@xh int output) as insert into sy (xm) values (@xm) select @xh=@@IDENTITY go declare @xh int exec up_tb '张三',@xh output select @xh /* ----------- 1 (1 行受影响) */