C
Craig Buchanan
I started with two table that I built in MS Access: Object and Person.
Object
------
Id AutoNumber,Long Integer,Indexed (No Duplicates),Primary Key
....
Person
------
ObjectId Number,Long Integer,Indexed (No Duplicates),Primary Key
....
I created a one-to-one relationship between these tables on
Object.Id=Person.ObjectId. I enabled referential integrity with
cascading updates and deletes.
I created a view that referenced all fields from the Object table and
all fields from the Person table except ObjectId.
When I run this view, I am able to add new records. It appears that the
AutoNumber value is being set in the Person table automatically.
Next, I upsized the tables to Sql Server 2000. I selected DRI as the
mechanism to enforce referential integrity.
I created a view in Sql Server that matched the one in Access. I am not
able to add new records, as I get a message indicating that the
Person.ObjectId can not be null. It appears that the AutoNumber value
is NOT being set in the Person table automatically.
Is there a way to get this to work in Sql Server like it working in
Access? If not, what is good approach?
Thanks,
Craig Buchanan
Object
------
Id AutoNumber,Long Integer,Indexed (No Duplicates),Primary Key
....
Person
------
ObjectId Number,Long Integer,Indexed (No Duplicates),Primary Key
....
I created a one-to-one relationship between these tables on
Object.Id=Person.ObjectId. I enabled referential integrity with
cascading updates and deletes.
I created a view that referenced all fields from the Object table and
all fields from the Person table except ObjectId.
When I run this view, I am able to add new records. It appears that the
AutoNumber value is being set in the Person table automatically.
Next, I upsized the tables to Sql Server 2000. I selected DRI as the
mechanism to enforce referential integrity.
I created a view in Sql Server that matched the one in Access. I am not
able to add new records, as I get a message indicating that the
Person.ObjectId can not be null. It appears that the AutoNumber value
is NOT being set in the Person table automatically.
Is there a way to get this to work in Sql Server like it working in
Access? If not, what is good approach?
Thanks,
Craig Buchanan