Hi @Nithiya,
Please avoid posting twice the same request. We do our best to answer in a timely manner, and seeing the same question twice will confuse other users of this forum.
Or did you intend to ask for something different than “TSQL custom rule implementation”?