Create foreign keys to create relationships between tables.
This lesson assumes that you have completed all preceding lessons. See Lesson 1: Creating a database file.
This lesson assumes that you have the roles and privileges listed in the Privileges section at the start of this tutorial: Tutorial: Creating a SQL Anywhere database.
In the left pane of Sybase Central, double-click Tables.
Click the SalesOrderItems table.
In the right pane, click the Constraints tab.
Start the Create Foreign Key Wizard. Click File » New » Foreign Key.
In the To which table do you want this foreign key to refer list, click the Products table.
In the What do you want to name the new foreign key field, type ProductIDkey.
In the Do you want this foreign key to reference the primary key or a unique constraint field, click Primary key.
In the Foreign Column list, click SalesOrderItemsID.
Discuss this page in DocCommentXchange.
|Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0|