September 19, 2007 at 11:59 am
I'm a unix guy that needs to do a few things on sql server and I can't figure out how to view all foreign keys on a table with t-sql (NOT em or query analyzer)
Anyone have any idea how to do this?
September 19, 2007 at 4:15 pm
How do you connect to SQL Server from Unix? What language/tools/libriaries do you use ?
* Noel
September 19, 2007 at 5:58 pm
I'm not connection from unix, I was trying to say that I'm not a novice, but I'm unfamiliar with MS products.
I figured out how to do what I wanted.
EXEC sp_fkeys @pktable_name = N'tblProducts'
The odd part of this stored procedure is that you have to supply the table the fk refers to, not the table it's assigned to :/
September 19, 2007 at 9:25 pm
The @fktable_name parameter doesn't work for you?
September 19, 2007 at 10:38 pm
You could use
sp_helpconstraint tblproducts
sp_help tblproducts
This will list you all the foreign keys the table is referring and also other Table referenceing this table.
September 21, 2007 at 1:22 pm
yeah,i was being obtuse :/
Thanks
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply