RE: Architecture SQL,Datasets and relationships

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Crad (anonymous_at_discussions.microsoft.com)
Date: 03/05/04


Date: Fri, 5 Mar 2004 02:51:06 -0800

You're right Kevin, but consider this scenario:
Customers and orders tables, with foreign key constraints both in sql server and dataset

You have an id in Custormers table with autoincrement set to true, so you're forced to update customers table first, in order to get the real id value, then update this id in the orders table and finally you can call the update method for the Orders DataAdapter

Now, if you are inserting a new customer it works fine (and it's the only way to do the work), but if you are deleting a customer you need to invert the order of the update method calls.

I had similar problem about a week ago and I had to disable the foreign key constraints in SQL Server.

Is there a better way to handle it?



Relevant Pages

  • Re: same application on multiple schemas
    ... As for the "comparison" with Sql Server, it was not intended to ask ... why Oracle does "not" support sql server behaviour:) I know oracle (I ... For every customer that will use our application, ... will use schema "SchemaA" ...
    (comp.databases.oracle.server)
  • Re: same application on multiple schemas
    ... As for the "comparison" with Sql Server, it was not intended to ask ... why Oracle does "not" support sql server behaviour:) I know oracle (I ... For every customer that will use our application, ... will use schema "SchemaA" ...
    (comp.databases.oracle.server)
  • Re: Index for username/password
    ... say that users want to be able to define customer ... A username in a login table is a little different. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • Re: Modeling/Constraint question
    ... there are no duplicates in the keys; ... Enter: the surrogate key. ... there is a customer number. ... SQL Server community, why should believe anything else you say? ...
    (comp.databases.ms-sqlserver)
  • Re: same application on multiple schemas
    ... As for the "comparison" with Sql Server, it was not intended to ask ... why Oracle does "not" support sql server behaviour:) I know oracle (I ... For every customer that will use our application, ... will use schema "SchemaA" ...
    (comp.databases.oracle.server)