I have table1 that has a Foriegn Key to table2, using the sql dmo i
am able to get the script from Table1 to create the Foreign key with
Table2 no problem
Set objTable = objDatabase.Tables("table1")
strSQLScript = objTable.Script(SQLDMOScript_DRI_ForeignKeys)
strSQLScript Now = "ALTER TABLE [TABLE1] ADD CONSTRAINT [FK_TABLE1]
FOREIGN KEY ( [Table2Id] ) REFERENCES [TABLE2] ( [Table2Id] ) NOT FOR
My question is: Is thier any way to do this backwards, I want to use
the DMO and Table2 to
find out if any relationships exist.
Thus returning TABLE1 and the script as noted above.
thanks in advance....