On Fri, Apr 23, 2010 at 2:35 PM, MB Software Solutions, LLC
<[email protected]> wrote:
> Stephen Russell wrote:
>> On Thu, Apr 22, 2010 at 11:50 PM, MB Software Solutions, LLC
>> <[email protected]> wrote:
>>> Try to avoid using a single view to update multiple tables via the
>>> native view means. The problem comes with the primary keys....if the
>>> view doesn't have a primary key for a table, how will it know which
>>> record(s) to update? You might have to resort to using explicit code to
>>> do the updates.
>> --------------------------
>>
>> The power of the guid as the PKey suddenly shines bright!
>>
>> When you assign the guid and put that in the row's memory container
>> before the insert it is all good at insert.
>
>
> Whether GUID or integer keys, he still faces the same problem. GUID
> doesn't bring a magical solution to this, unless I'm misunderstanding.
-------------------------
Point I thought I was making is that a guid can be created ANYWHERE
and not as an aspect of in insert. So that same value is placed in
both PK & FKey segments of the row, and a second guid is generated for
the Child table PKey.
Not sure if this would work because I never insert into a view that is
joined myself.
Because you have cursorupdate method I have no idea if it checks for
present data and updates and if no data it inserts. I don't have that
method.
Found out that I cannot "Msg 4405, Level 16, State 1, Line 9
View or function 'lvTest' is not updatable because the modification
affects multiple base tables."
insert into lvTest (id, name, id2, t1id, othername)
values ('c727b527-eb71-40a4-9cdb-87b98a27c35b' , 't1 name',
'81BC986A-FB2D-48ef-AAFB-9ED6613D5E32','c727b527-eb71-40a4-9cdb-87b98a27c35b',
'test2 other name')
--
Stephen Russell
Sr. Production Systems Programmer
CIMSgts
901.246-0159 cell
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.