generator fix to determine foreign keys in MS SQL Server