Function not returning multiple results
The function below is returning one record instead of multiple, it's a
Scalar-valued function I created ...
ALTER FUNCTION [_SMDBA_].[ASSETTAG](@ticket int)
RETURNS VARCHAR(MAX)
AS
BEGIN
-- Declare the return variable here (asset#)
DECLARE @assettag VARCHAR(MAX)
-- Query to return all the tasset #s
SELECT @assettag = "Asset/Tag #" from sde."_SMDBA_"."Inventory Items"
where "Configuration ID"=(select "Client ID" from sde."_SMDBA_"."Incident"
where "Incident #"=@ticket)
-- Return the result of the function
RETURN @assettag
END
Any idea how to return multiple results?
No comments:
Post a Comment