Prev: Problem passing exception from AppDomain
Next: null reference exception could result at runtime
From: Gilbert Tordeur on 7 Apr 2010 12:02 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
From: Tom Dacon on 7 Apr 2010 13:18 "Gilbert Tordeur" <gilbert.tordeur(a)orange.fr> wrote in message news:epHLDvm1KHA.3744(a)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 > On SQL Server, it's: select * from sys.foreign_keys works for sure on SQL Server 2005, don't know about others. Tom Dacon Dacon Software Consulting
From: Patrice on 7 Apr 2010 13:28 > I have found many post telling how to create a foreign key with SMO but no > one explaining how to list them. Or try 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
From: Gilbert Tordeur on 8 Apr 2010 03:02 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
From: Gilbert Tordeur on 8 Apr 2010 03:02 Hi Patrice. Wonderful ! Thank you, Gilbert.
|
Pages: 1 Prev: Problem passing exception from AppDomain Next: null reference exception could result at runtime |