I have a stored procedure. I need to get the two select statements into variables. I need to compare both counts and create and error rountine if they do not much. I am enclosing the code, but would also like help on the error handler;

Please assist thanks

CREATE procedure dbo.SpLaLaMonitor
@TestDate smalldatetime= '11/24/00 11:00'

SELECT COUNT (*)as 'what does text here produce?' from dev1.dbo.vw_look_txn Where vendor_err='x' and created_dt>@TestDate

SELECT COUNT (*) as 'what does text here produce?' from Merchant_Order mo join Order_Line ol on ol.Order_ID = mo.Order_ID Where La_To_La=1 and mo.Modified_Date>@TestDate


EXEC dbo.SpLaLaMonitor

--GO