I have an issue where I want to execute a stored procedure within another procedure and pass a Unique Identifier through to that second StoredProc.
The receiving StoredProc is a error reporting procedure that records when an error has occurred for bug fixes requirements. One of those fields is a Decription of the error. I want to pass through, as shown in the code: 'Portal ID passed does not exist: ' + @nPortalUID, but I get the error: Line 23: Incorrect syntax near '+'.
I have also tried to send through just the nPortalUID value but get the response: 'Operand type clash: uniqueidentifier is incompatible with text'.
I have tried converting the data type to nvarchar and text (the receiving fields data type is Text), but nothing seems to be working.
ALTER PROCEDURE [dbo].[FeatureSettings]
@nFeatureId int = 0,
@nPortalUID uniqueidentifier = ''
-- Check for UID and set portal id
DECLARE @nPortalId int
SET @nPortalId = ISNULL((SELECT aPortalId FROM System_Portals WHERE nPortalUniqueId = @nPortalUID),0)
-- get features details
IF @nPortalId <> 0
-- Catch error
EXEC System_ErrorHandle 'FeatureSettings','StoredProc','Portal ID passed does not exist: '+@nPortalUID,0