ALTER PROCEDURE [dbo].[Time_Insert]
@ip varchar(50) ,
@RETURN_ID int = 0 OUTPUT
as
begin
declare @tmp int
insert into WorkTime(UserID,Time)
select UserID ,getdate() from EmployeeInfo as E where E.ip=@ip
select @tmp=UserID
set @RETURN_ID=@tmp
return @@ERROR
end
我想得到UserID的值,应该怎么写这个存储过程,谢谢!
@ip varchar(50) ,
@RETURN_ID int = 0 OUTPUT
as
begin
declare @tmp int
insert into WorkTime(UserID,Time)
select UserID ,getdate() from EmployeeInfo as E where E.ip=@ip
select @tmp=UserID
set @RETURN_ID=@tmp
return @@ERROR
end
我想得到UserID的值,应该怎么写这个存储过程,谢谢!
ALTER PROCEDURE [dbo].[Time_Insert]
@ip varchar(50) ,
@RETURN_ID int = 0 OUTPUT
as
begin
declare @tmp int select @RETURN_ID = UserID from EmployeeInfo as E where E.ip=@ip insert into WorkTime(UserID,Time)
select @RETURN_ID ,getdate()
return 0
end declare @id int
exec Time_Insert 1,@id output
print @id
应该怎么调用呢?
@ip varchar(50) ,
@RETURN_ID int = 0 OUTPUT
as
begin
declare @tmp int
insert into WorkTime(UserID,Time)
select UserID ,getdate() from EmployeeInfo as E where E.ip=@ip
select @RETURN_ID=UserID from EmployeeInfo as E where E.ip=@ip return @@ERROR
end
exec Time_Insert @ip ,@I output
实现select * from where id="return_id"
怎么写,ip的参数不需要。