显示过程中变量值的sql查询
我使用microsoft sql server 2012创建了数据库,现在我需要从使用此查询的过程中获取一个值:显示过程中变量值的sql查询,sql,sql-server,variables,select,null,Sql,Sql Server,Variables,Select,Null,我使用microsoft sql server 2012创建了数据库,现在我需要从使用此查询的过程中获取一个值: begin try begin tran -- Insert statements for procedure here Insert Into dbo.parents (FatherFirstName,FatherLastName,MotherFirstName,MotherLastName,ParentIdNum,VolunteerId,Addre
begin try
begin tran
-- Insert statements for procedure here
Insert Into dbo.parents
(FatherFirstName,FatherLastName,MotherFirstName,MotherLastName,ParentIdNum,VolunteerId,Address)
values
(@FFname,@FLname,@MFname,@MLname,@IDnum,@VolunteerId,@add)
set @returnVal = 'good'
commit tran
end try
begin catch
rollback tran
set @returnVal = 'error!'
end catch
然后我使用:
declare @param sysname
exec dbo.uspCreateNewParents 1,'xxxxx','xxxxx','xxxxx','xxxxx','xxxxx','xxxxx',@param
select @param
我得到的是空值,列名是@param….的值
请帮助我如何检索变量的值 什么变量的值?您是否在存储过程中将
@returnVal
声明为输出
变量?如果您可以显示整个存储过程,那会有所帮助。请发布存储过程定义。