Hi,
Having (probably) a newbie problem with returnvalues from a stored procedure.
I am calling this proceure from within another procedure:
CREATE PROCEDURE PartsCap_GetSystemID
@SystemName varchar(50)
AS
--System.ID is a uniqueidentifier.
Select System.ID from System
Where System.Name = @SystemName
GO
The real procedure are much larger but this produces the same problem, I do the call to this procedure from within another procedure:
CREATE PROCEDURE PartsCap_Exec
@SystemName as varchar(50)
AS
Declare @SystemID uniqueidentifier
EXEC @SystemID = PartsCap_GetTextTypeID @SystemName
print @SystemID
GO
The problem I am facing is that the variable @SystemID has the value "0".
If I do:
EXEC PartsCap_GetSystemID @SystemName
the result is fine..
I have also played around a bit with RETURN but that only complains that it cannot convert a uniqeidentifier to an int.
Anny ideas?
Thankyou for taking your time..
Having (probably) a newbie problem with returnvalues from a stored procedure.
I am calling this proceure from within another procedure:
CREATE PROCEDURE PartsCap_GetSystemID
@SystemName varchar(50)
AS
--System.ID is a uniqueidentifier.
Select System.ID from System
Where System.Name = @SystemName
GO
The real procedure are much larger but this produces the same problem, I do the call to this procedure from within another procedure:
CREATE PROCEDURE PartsCap_Exec
@SystemName as varchar(50)
AS
Declare @SystemID uniqueidentifier
EXEC @SystemID = PartsCap_GetTextTypeID @SystemName
print @SystemID
GO
The problem I am facing is that the variable @SystemID has the value "0".
If I do:
EXEC PartsCap_GetSystemID @SystemName
the result is fine..
I have also played around a bit with RETURN but that only complains that it cannot convert a uniqeidentifier to an int.
Anny ideas?
Thankyou for taking your time..