I am attempting to return a string from a query in a stored procedure my code returns the following error. Can anyone tell me the correct method to achieve this?
Stored Procedure:
ALTER PROCEDURE FindDetail
@JobID int
AS
SET NOCOUNT ON
Declare @Txt nvarchar(80)
set @txt = (SELECT ItemId, ColAddrName, ColAddr3, DelAddr3
FROM Job
WHERE (ItemId = @JobID))
RETURN @txt
Error:
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS
Start Free Trial