Page 1 of 1

TMSMetaData functionality extension

Posted: Fri 25 Jun 2010 09:01
by Lithiumâ„¢
The TMSMetaData have a ObjectType propety and otForeignKeys - one of many enumerated value for this property. With this value TMSMetaData return all foreign keys on which specified table refrences. The query use sp_foreign_keys_rowset2 strored procedure to get that data.

I need to get all foreign tables which references on primary key of specified table, it could use sp_foreign_keys_rowset stored procedure. Please tell me how can I do it with TMSMetaData?

Posted: Tue 29 Jun 2010 10:35
by Dimon
To get the foreign key list we don't use the sp_foreign_keys_rowset2 stored procedure, but use the IDBSchemaRowset.GetRowset method, that returns the same result as the one returned by that stored procedure.
You can execute the sp_foreign_keys_rowset procedure using the TMSStoredProc component.

Posted: Wed 30 Jun 2010 05:17
by Lithiumâ„¢
Thank you for response. It means IDBSchemaRowset.GetRowset uses sp_foreign_keys_rowset2 stored procedure, because SQL profiler show nothing except this. I known about using TMSStoredProc or even TMSQuery. But was better to use TMSMetaData to this effect, on that I hoped.