Correct way to retrieve key information for a table during a Stored procedure

  • Thread starter Thread starter JerryK
  • Start date Start date
J

JerryK

Hi,

I have a Stored Procedure that retrieves a series of records in a parent
child hierarchy. That is it retrieves the parent record and it's children.
I would also like to retrieve information on the relationships between the
parent and the children (ie. primary key, secondary key, relations etc.).
Someone suggested doing a FillSchema, but this seems to create a duplicate
table entry for each table the retrieve returns. Is there a better way?


Thanks,

jerry
 
Jerry,

You can't retrieve the relatins through normal means. You could run an
additional query against the database, such as against the
InformationSchemas or sp_help of SQL Server.

Kathleen
 
Interesting.

So is that how most people getting the information required to set up
relationships between tables in dataset? They retrieve the data and then
execute a second query against sp_help? Or is there an alternate way of
ensuring the relations between tables in a dataset match those of the
relations in the database?

jerry
 
Back
Top