See query example below.. I want to set a variable if only 1 record exists.. If no records exists I want to do something if more than 1 record exists I want to do something else..
Set @Lid = (Select Lid from table)--- only if 1 record exists
If @@Rowcount < 1
If @@Rowcount > 1
Print 'different error'