I want to write some thing like that query.
BEGIN
SQL
DECLARE @Unaloacte int;
DECLARE @Total int;
DECLARE @Flag int;
SET @Unaloacte =( Select count(PD.PropertyDetailId)
from PropertyDetail AS PD join SiteDetail AS SD ON PD.SiteDetailId=SD.SiteDetailId
Where PD.CustomerId SET @Total= (Select count(PropertyDetailId) as Total_Count from PropertyDetail
where SiteDetailId=27) ;
if( @Unaloacte = @Total)
Delete something and display message print"Delete";
else
print"Not able to delete"
ENDI hope you understand my problem.......!!!

Nitin SontakkeRank #264 · 9.6K reputationPosted Nov 10, 2016, 12:31 AM EST
Manas MohapatraRank #182 · 13.2K reputationPosted Nov 10, 2016, 1:26 AM EST