Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention. Check out this how-to article for more information.
declare @maxcount as varchar(10) select @maxcount = count(id_number)from dbo.iqm_newemployees select @maxcount if @maxcount >= 3 Select @maxcount DECLARE @ProductTotals TABLE ( [id_number] [int] NOT NULL, [employee_name] [varchar](51) NOT NULL, [account_disabled] [bit] NOT NULL, [startdate] [datetime] NULL, [defaultlocation] [int] NULL ) insert into @ProductTotals(id_number,employee_name,account_disabled,startdate,defaultlocation) select id_number,employee_name,account_disabled,startdate,defaultlocation from dbo.iqm_newemployees where status = 0 select * from @ProductTotals EXEC msdb.dbo.sp_send_dbmail @email@example.com', @body= 'select * from @producttotals', @subject = 'new record inserted', @profile_name = 'Arjayreddysemail' else select 'test'
Join the community of 500,000 technology professionals and ask your questions.