I have a stored procedure which returns a topic and it's replies. But I have a problem with it. If there aren't any replies for it, the topic itself aren't displayed either. I know the 'inner join' is the reason but nothing I tried worked either. I tried 'left join','right join','left outer join','right outer join' but none of them worked. I can't understand, 'left outer join' should work but I doesn't, still returns empty recordset (in QA). Can you take a look at it please? Here's the sp:create procedure proc_GetTopic@topicID int,@LOWER_LIMIT int=0,@UPPER_LIMIT int=25asset nocount ondeclare @sql nvarchar(3000)set @sql='select dbo.[TOPICS].T_Forum as T_Forum, dbo.[TOPICS].T_ID as T_ID, dbo.[TOPICS].T_Title as T_Title, dbo.[TOPICS].T_Date as T_Date, dbo.[TOPICS].T_Message as T_Message, dbo.[MESSAGES].M_ID as M_ID, dbo.[MESSAGES].M_TopicID as M_TopicID, dbo.[MESSAGES].M_Time as M_Time, dbo.[MESSAGES].M_Message as M_Message,from dbo.[MESSAGES] inner join dbo.[TOPICS] on dbo.[MESSAGES].M_TopicID = dbo.[TOPICS].T_IDwhere M_ID not in(select top '+convert(varchar, @LOWER_LIMIT)+' M_ID from dbo.[MESSAGES] where M_TopicID='+convert(varchar, @topicID)+' order by M_ID desc)and M_ID in(select top '+convert(varchar, @UPPER_LIMIT)+' M_ID from dbo.[MESSAGES] where M_TopicID='+convert(varchar, @topicID)+' order by M_ID desc)anddbo.[TOPICS].T_ID='+convert(varchar,@topicID)+' order by M_Date desc'exec dbo.sp_executesql @sql