Relationship doesn't upsize - SQL7 rookie

Relationship doesn't upsize - SQL7 rookie

Post by Dan Muhlenkam » Sun, 04 Jun 2000 04:00:00



I have a simple relationship on a local database between an account number
index (candidate) in an accounts table to a account number index (regular)
in a transaction table.  Whenever I use the wizard to upsize this simple
relationship to MS SQL 7, the relationship is not present in the SQL
database.  I either need to be able to upsize it, or create the relationship
from within MS SQL 7.  Help Please.

Thanks, Dan

 
 
 

Relationship doesn't upsize - SQL7 rookie

Post by Anders Altber » Sun, 04 Jun 2000 04:00:00


The account number table should perhaps have a Primray Key not a Candidate
index.
A "relationbship" is a Primary Key - Foreign Key thing n SQL terms.
-Anders


Quote:> I have a simple relationship on a local database between an account number
> index (candidate) in an accounts table to a account number index (regular)
> in a transaction table.  Whenever I use the wizard to upsize this simple
> relationship to MS SQL 7, the relationship is not present in the SQL
> database.  I either need to be able to upsize it, or create the
relationship
> from within MS SQL 7.  Help Please.

> Thanks, Dan


 
 
 

Relationship doesn't upsize - SQL7 rookie

Post by Dan Muhlenkam » Mon, 05 Jun 2000 04:00:00


Are you saying MS SQL only support relationships in which the parent table
primary key is used.  The accounts table does have a primary key, but it is
not what this relationship happpens to be built upon.

Thanks for all your help.
Dan


> The account number table should perhaps have a Primray Key not a Candidate
> index.
> A "relationbship" is a Primary Key - Foreign Key thing n SQL terms.
> -Anders



> > I have a simple relationship on a local database between an account
number
> > index (candidate) in an accounts table to a account number index
(regular)
> > in a transaction table.  Whenever I use the wizard to upsize this simple
> > relationship to MS SQL 7, the relationship is not present in the SQL
> > database.  I either need to be able to upsize it, or create the
> relationship
> > from within MS SQL 7.  Help Please.

> > Thanks, Dan

 
 
 

Relationship doesn't upsize - SQL7 rookie

Post by Anders Altber » Tue, 06 Jun 2000 04:00:00


Dan
No, but the upsizing wizard may think so. Quoting from SqlServer
Books Online :
"The Keys collection contains Key objects referencing referential integrity
declarations that are implemented by Microsoft? SQL Server? PRIMARY KEY and
FOREIGN KEY constraints."

and

"A foreign key (FK) is a column or combination of columns used to establish
and enforce a link between the data in two tables. A link is created between
two tables by adding the column or columns that hold one tables primary key
values to the other table. This column becomes a foreign key in the second
table."

and

"When a FOREIGN KEY constraint is added to an existing column or columns in
the table, Microsoft? SQL Server? by default checks the existing data in the
columns to ensure that all values, except NULL, exist in the column(s) of
the referenced PRIMARY KEY or UNIQUE constraint. "

So in fact a Unique constraint can be the target of a foreing key
constraint.

-Anders

-Anders


> Are you saying MS SQL only support relationships in which the parent table
> primary key is used.  The accounts table does have a primary key, but it
is
> not what this relationship happpens to be built upon.

> Thanks for all your help.
> Dan



> > The account number table should perhaps have a Primray Key not a
Candidate
> > index.
> > A "relationbship" is a Primary Key - Foreign Key thing n SQL terms.
> > -Anders



> > > I have a simple relationship on a local database between an account
> number
> > > index (candidate) in an accounts table to a account number index
> (regular)
> > > in a transaction table.  Whenever I use the wizard to upsize this
simple
> > > relationship to MS SQL 7, the relationship is not present in the SQL
> > > database.  I either need to be able to upsize it, or create the
> > relationship
> > > from within MS SQL 7.  Help Please.

> > > Thanks, Dan