Jaa


ForeignKey Constructor (Table, String)

Initializes a new instance of the ForeignKey class on the specified table with the specified name.

Namespace: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntax

'Declaration
Public Sub New ( _
    table As Table, _
    name As String _
)
public ForeignKey (
    Table table,
    string name
)
public:
ForeignKey (
    Table^ table, 
    String^ name
)
public ForeignKey (
    Table table, 
    String name
)
public function ForeignKey (
    table : Table, 
    name : String
)

Parameters

  • table
    A Table object value that specifies the table on which to create the foreign key.
  • name
    A String value that specifies the name of the foreign key.

Remarks

This namespace, class, or member is supported only in version 2.0 of the Microsoft .NET Framework.

Example

How to: Create, Alter, and Remove a Foreign Key in Visual Basic .NET

Platforms

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

See Also

Reference

ForeignKey Class
ForeignKey Members
Microsoft.SqlServer.Management.Smo Namespace

Other Resources

Creating, Altering, and Removing Foreign Keys
Creating and Modifying FOREIGN KEY Constraints
CREATE TABLE (Transact-SQL)