TMSMetaData functionality extension

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Lithium™
Posts: 42
Joined: Wed 23 Jun 2010 06:42

TMSMetaData functionality extension

Post by Lithium™ » Fri 25 Jun 2010 09:01

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?

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 29 Jun 2010 10:35

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.

Lithium™
Posts: 42
Joined: Wed 23 Jun 2010 06:42

Post by Lithium™ » Wed 30 Jun 2010 05:17

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.

Post Reply