|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to get the list of all SQL Server foreign keys in a database by using Microsoft.SqlServer.ManageHello.
I have found many post telling how to create a foreign key with SMO but no one explaining how to list them. Anybody knows ? Thank you, Gilbert "Gilbert Tordeur" <gilbert.tord***@orange.fr> wrote in message On SQL Server, it's:news:epHLDvm1KHA.3744@TK2MSFTNGP04.phx.gbl... > Hello. > > I have found many post telling how to create a foreign key with SMO but no > one explaining how to list them. > > Anybody knows ? > > Thank you, > Gilbert > select * from sys.foreign_keys works for sure on SQL Server 2005, don't know about others. Tom Dacon Dacon Software Consulting Hi Tom.
Many thanks for your answer. In fact I was looking for an answer using SMO, independent of any SQL Server version and more appropriate - for me - with dotnet spirit. Another post gave me the answer. Regards, Gilbert > I have found many post telling how to create a foreign key with SMO but no Or try > one explaining how to list them. http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.table.foreignkeys.aspx if you want to keep using SMO. Not familiar enough with SMO to know if you can query all FKs in one go... -- Patrice
Problem passing exception from AppDomain
want to convert string into byte array hw i can do it datagridview Combobox column Adding/copying Worksheet to Excel Programmatically add Sub Menus to a ContextMenuStrip HTML report in vb.net master - detail architecture for dataTable. textBox databinding. Sorry for reposting - can not figure out... Reading filenames into listbox |
|||||||||||||||||||||||