I just checked your blog....
It looks like you are checking with the column name which are ending with ID (correct me if I am wrong), but this may not be true always to find all the columns...
Nothing is Permanent... even Knowledge....
You can query the information schema tables. There's a script that should be able to provide that information. I use that in my code repository. Let me know if you need a copy.
Greg http://www.freewebstore.org/tsqlcoderepository Powerful tool for SQL Server development
The story here is one of my client asked me to send a Schema of DB. I generated schema and sent to him.
He raised a doubt that this DB contains lot of FK's but your script contians only few FK's.
You better to write a DDL script to find missing FK's.
I used below script to locate all foreign key in DB:
SELECT * FROM sys.all_objects WHERE type =
* FROM sys.foreign_keys
is this scripts are sufficient to know all FK's in DB or anything i have to modify?