Re: Is there a solution to this?
- From: "J. M. De Moor" <someone@xxxxxxxxxxxxx>
- Date: Thu, 5 May 2005 22:07:05 -1000
Siddharth
What is the constraint between the tables? Also, is it possible to have a
name with no address or vice versa? On a row in either table, are the name
or address columns NULLable? You don't spell these out in your question. If
you provide the DDL it would help. The engine probably can't tell what to
do with the VIEW you describe because and insert can introduce anomalies.
(INNER JOINS using a single column can imply a one side on the target table
in a one to many relationship. MDBs let you get away with that by making
dangerous assumptions.)
You don't say what version of SQL Server you are using, but you can use
INSTEAD OF triggers to spell out what to do on an INSERT using a VIEW. See
BOL.
Joe
"Siddharth Parekh" <skparekh@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:e%23$aAVbUFHA.3076@xxxxxxxxxxxxxxxxxxxxxxx
> Lets say I have two tables, table1 and table2 that have a one to one
relationship
>
> Table1 has two columns - number, name
> Table2 has two columns - number, address
>
> number is the primary key and is numeric format.
>
> If i combine these two using a View having a simple SELECT statement like
the following:
>
> SELECT table1.number, table1.name, table2.address
> FROM table1 INNER JOIN table2 ON table1.number=table2.number;
>
> This will give the output in the following format:
>
> NUMBER NAME ADDRESS
>
> The resulting recordset can be modified but if new records are added to
this, then it gives a write conflict. The same thing in a MDB works great.
>
> Any ideas how to overcome the write conflict?
>
> Thanks,
> Sid.
.
- Follow-Ups:
- Re: Is there a solution to this?
- From: Siddharth Parekh
- Re: Is there a solution to this?
- References:
- Is there a solution to this?
- From: Siddharth Parekh
- Is there a solution to this?
- Prev by Date: Re: ADP or MDB - which is a better front end for SQL Server?
- Next by Date: Re: ADP Setting SourceObject to a Table from another user
- Previous by thread: Is there a solution to this?
- Next by thread: Re: Is there a solution to this?
- Index(es):
Relevant Pages
|