Classe ForeignKey

The ForeignKey object represents a SQL Server foreign key.

Espace de noms :  Microsoft.SqlServer.Management.Smo
Assembly :  Microsoft.SqlServer.Smo (dans Microsoft.SqlServer.Smo.dll)

Syntaxe

'Déclaration
Public NotInheritable Class ForeignKey _
    Inherits ScriptNameObjectBase _
    Implements ICreatable, IDroppable, IMarkForDrop, IAlterable,  _
    IRenamable, IExtendedProperties, IScriptable, IPropertyDataDispatch
'Utilisation
Dim instance As ForeignKey
public sealed class ForeignKey : ScriptNameObjectBase, 
    ICreatable, IDroppable, IMarkForDrop, IAlterable, IRenamable, 
    IExtendedProperties, IScriptable, IPropertyDataDispatch
public ref class ForeignKey sealed : public ScriptNameObjectBase, 
    ICreatable, IDroppable, IMarkForDrop, IAlterable, IRenamable, 
    IExtendedProperties, IScriptable, IPropertyDataDispatch
[<SealedAttribute>]
type ForeignKey =  
    class
        inherit ScriptNameObjectBase
        interface ICreatable
        interface IDroppable
        interface IMarkForDrop
        interface IAlterable
        interface IRenamable
        interface IExtendedProperties
        interface IScriptable
        interface IPropertyDataDispatch
    end
public final class ForeignKey extends ScriptNameObjectBase implements ICreatable, IDroppable, IMarkForDrop, IAlterable, IRenamable, IExtendedProperties, IScriptable, IPropertyDataDispatch

Notes

To get ForeignKey object properties, users can be a member of the public fixed server role.

To set ForeignKey object properties, users must have ALTER permission on the parent table or be a member of the db_owner fixed database role.

To create or drop a foreign key, users must have ALTER permission on the parent table or be a member of the db_owner fixed database role.

Thread Safety

Tout membre statique public (Partagé dans Microsoft Visual Basic) de ce type est sûr dans le cadre des opérations à plusieurs threads. Tous les membres de l'instance ne sont pas garantis comme sûrs.

Sécurité des threads

Tous les membres publics static (Shared dans Visual Basic) de ce type sont thread-safe. Il n'est pas garanti que les membres d'instance soient thread-safe.