July 29, 2015 at 2:24 pm
I have a afunction to check the reference number, also a stored procedure is written .
The stored procedure passes the reference number to the function 'checkref' which returns a '1' or 'o' (BIT)
I want this value passed to the stored procedure.but I'm having problems trying to capture the value returned from the function.
This is the draft stored procedure :
SET NOCOUNT ON
DECLARE @found varchar(1)
EXEC dbo.Check_ref (Ref, @found ) OUTPUT
SET NOCOUNT OFF
SELECT @found AS msg
.....
Many thanks if you can just.give me some help
Thank you
.
July 29, 2015 at 3:31 pm
parry (7/29/2015)
I have a afunction to check the reference number, also a stored procedure is written .The stored procedure passes the reference number to the function 'checkref' which returns a '1' or 'o' (BIT)
I want this value passed to the stored procedure.but I'm having problems trying to capture the value returned from the function.
This is the draft stored procedure :
SET NOCOUNT ON
DECLARE @found varchar(1)
EXEC dbo.Check_ref (Ref, @found ) OUTPUT
SET NOCOUNT OFF
SELECT @found AS msg
.....
Many thanks if you can just.give me some help
Thank you
.
You don't call a function with EXEC (that is for stored procedures).
For a scalar function, you would call it like:
DECLARE @found BIT;
SET @found = Check_ref(whatever you pass to it);
SELECT @found;
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply