Take the 2-minute tour ×  I am running the following query and
checking whether it returns any results and if not I need
implement some logic in my sp. I have given couple of code
blocks below from my sp.  select * from temp where (select *
table1 where Id='4728')=0  If the table1 doesnt have any records
it shouldn't return any results and I need to know whether I am
checking it correctly.  INSERT INTO #companies     SELECT
DISTINCT c.Company_Id         INNER JOIN Request_Summary rs ON
c.Company_ID=rs.Company_ID             rs.IsMember_Ind <> 0
AND (SELECT COUNT(*) FROM Monitor_Request mr WHERE
mr.Company_ID=c.Company_ID)< 5                        -- I am
checking it here             AND EXISTS(SELECT COUNT(*) FROM
Monitor_Request mr2 WHERE mr2.Company_ID=c.Company_ID)
AND NOT EXISTS(                 SELECT * FROM TaskAction ta
WHERE                  ta.FirstActionTypeId = @firstActionTypeId
and                  ta.TaskTypeId = @taskTypeId and
ta.NextAction