_:n4d11b2d9681741abac0ae246771d2da4xb5
<http://schema.org/text>
"Dear pandeyismThanks for your valuable reply I am getting my output by using below Stored ProcedureCREATE PROCEDURE CheckAndIpdate    ItemId INT    OrderId INTASBEGIN    Declare ItemStatCnt int\t\t\t    Declare ItemCnt int\t\t    UPDATE TblItms SET ItemStatus39C39 WHERE ItemIdItemId AND FKorderIdOrderId \t    SET ItemCntSELECT Count as ItmCnt FROM TblItms WHERE ItemIdItemId AND FKorderIdOrderId    SET ItemStatCntSELECT Count as ItemStatCnt FROM TblItms WHERE FKorderIdOrderId AND ItemStatus39C39    IFItemCntItemStatCnt    BEGIN        UPDATE TblOrdrs SET OrderStatus39C39 WHERE OrderId  OrderId    END\tEND"
<https://www.aspsnippets.com/questions/415658/Update-Primary-Table-and-records-having-dependencies-in-SQL-Server/>