declare @Input int,
select @Input= ?,
@ID = ?
if(@Input = 1)
delete from Institutes
where @ID not in(select InstituteID from Res_UserEducationMapping)
if(@Input = 2)
delete from Company
where @ID not in (select CompanyID from Res_UserExperienceMapping)
if(@Input = 3)
delete from country
where @Record not in(select Country from User_AddressDetails)
and @Record not in(select Country from University)
and @Record not in(select Country from Res_UserExperienceMapping)
and @Record not in(select Country from Res_UserEducationMapping)
above Query will delete record from the table depending on Input parameter and where clause
Now the problem is that, I want to set the temporary variable depending on whether delete statement executes or not
Set @Temp = 1 if delete executes
set @Temp = 0 if not
how to do this?
can anubody help?