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

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
 
K

Kathleen Dollard

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
 
J

JerryK

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top