我被困在这个存储过程中分配的变量值上。
@EntityID int,
@Title1 varchar(10) OUTPUT,
@Title2 varchar(10) OUTPUT
AS
Declare @T1 varchar(10)
Declare @T2 varchar(10)
BEGIN
SELECT
dbo.Entity.EntityID, dbo.Types.TypeName AS Title1, Types_1.TypeName AS Title2
FROM
dbo.Entity
LEFT OUTER JOIN
dbo.Types AS Types_1 ON dbo.Entity.Title2 = Types_1.TypeID
AND dbo.Entity.Title2 = Types_1.TypeID
LEFT OUTER JOIN
dbo.Types ON dbo.Entity.Title1 = dbo.Types.TypeID
WHERE
(dbo.Entity.EntityID = @EntityID)
END
我正在尝试返回Title1
and的值Title2
。查询有效,并返回值,但我需要在其他地方使用它们。