开发者

SQL Query returning only one record

I am attempting to run a simple SQL stored procedure query, but am getting only 1 record returned. Anyone know what the issue is?

Alter PROCEDURE spGetRecruiterList
AS
BEGIN
    SET NOCOUNT OFF;
    DECLARE @TitleID as int
    set @TitleID = (Select TitleID 开发者_开发问答from tblJobTitle where JobTitle = 'Recruiter')
    Print @TitleID

    Select p.PersonID, p.FirstName, p.MiddleName, p.LastName
    from tblPerson p
    INNER JOIN dbo.tblLinkTitleToPerson tp 
    ON p.PersonID = tp.PersonID 
    WHERE tp.PersonID = @TitleID
    Order By p.LastName
END
GO


 WHERE tp.PersonID = @TitleID

Should be

 WHERE tp.TitleID = @TitleID

(probably!)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜