Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Foreign Key Assistance....
Message
 
To
21/02/2002 13:46:18
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00623263
Message ID:
00623358
Views:
12
>Tom
>
>Could you possibly explain how this is done? I mean using simple examples.
>
>Thanks!
>
>Nicky

Nicky;

Wish I was there to show you. There are two approaches I can think of one of which is in the on line help under:
Contents
	Microsoft Management Console
		Creating and Maintaining Databases
			Tables
Look for “Foreign Keys” there are several entries.

Another way to do it (quick and dirty) is to create your entity diagrams and assign a foreign key. This diagram might just be a piece of paper you use to define each field in each table before you create it. You then go to your SQL Server tables in design mode and just be consistent with the size and data type from one table to another. It goes without saying you must have a primary or unique key to distinguish each record. The foreign key will be the same data type and size as the primary or unique key. Above all be consistent and this will work.

The primary or unique key of the referenced table becomes the foriegn key of table of interest. Hope this makes sense - when you do it all the time anything makes sense! :) Trying to explain anything over the Internet or telephone can be fun! :)

Tom
Previous
Reply
Map
View

Click here to load this message in the networking platform