April 30, 2003 at 1:52 am
I was just wondering if I could get some advice about retrieving foreign keys from a table.
We are writing a database in SQL server, while the frontend will be in PHP. We have a series of lookup tables, which we want the users to be able to add to, or modify. Some of these lookups are linked to other tables, but not all. We want to write a generic PHP page to modify these tables, so the tables with foreign keys should also show the info from the linked table.
I know you can retrieve the foreign keys by accessing the system tables, but I read that you are not supposed to do that. I can't name the foreign keys columns (eg fkTablename_), as more than one table may link to a primary key.
How would you recommend that I do this?
April 30, 2003 at 7:27 am
You may try EXEC sp_fkeys 'authors'.
April 30, 2003 at 7:44 am
thanks!!!
that works fine.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply