I've got the following stored procedure: CREATE PROCEDURE dbo.zz_populate_email_endings ASBegin Declare @company varchar(100), @coID int, @results int, @emailending varchar(100) Declare Cursid Cursor for Select company_id from sales_company order by company_idCreate Table #temp1 (Ending Varchar(200), Company varchar(200), EmailCount int) open Cursidfetch next from cursid into @coIDwhile (@@fetch_status<>-1) Begin select @company=company_name from sales_company where company_id=@coIDInsert into #temp1 select substring(email, charindex('@', email), len(email)+1-charindex('@', email)) as [EmailEnding], max(isnull(company_name, 'n/a')), count(substring(email, charindex('@', email), len(email)+1-charindex('@', email))) as EmailTotal from smc_new_products.dbo.usr_smc where company_name like @company+'%' or email like '@' + @company + '%' group by substring(email, charindex('@', email), len(email)+1-charindex('@', email)) order by emailtotal desc--Find out if there are 0 results, 1 result, or many results here--?if @results=0 begin update sales_company set multiple_hits=0 where company_id=@coID end if @results=1 begin update sales_company set multiple_hits=0 where company_id=@coID exec ap_link_email_company @company, @emailending end if @results>1 begin update sales_company set multiple_hits=1 where company_id=@coID end --reset stufftruncate table #temp1fetch next from cursid into @coIDEnd deallocate CursidPrint 'complete'EndGOI have two quick (and hopefully easy to answer) questions: 1. How do I determine how many rows I have in my #temp1 table? 2. I think I've used the "exec" command correctly to kick off another stored proc in my "if @results=1 " section....haven't I?