SQL custom rule for foreign key

Hi - We have tsql file which contains create script of sql table and constraints for foreign key.
Can you please guide me to write custom rule to check if all tables in the script has atleast one foreign key constraint defined.

Thanks
Nithiya

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”?