[dba-SQLServer] View not updatable because

Francisco Tapia fhtapia at gmail.com
Wed Oct 28 14:54:17 CDT 2009


I think you want to write up your statement as a delete statement, not  
adelete from view but a delete from a table does that make sense?
The result is that you'd use a sproc (stored procedure) to help delte  
records and not a standard statement.

Sent from my mobile

On Oct 28, 2009, at 9:38 AM, jwcolby <jwcolby at colbyconsulting.com>  
wrote:

> What I have found on GOOGLE is that the FROM clause can only  
> reference a single table.  But if I am
> going to select records by a join, then by definition the where  
> clause will reference more than one
> table.
>
> HELP!!!
>
> TIA.
>
> John W. Colby
> www.ColbyConsulting.com
>
>
> jwcolby wrote:
>> I have never figured out how to do the following...
>>
>> I have a table which contains records that I need to delete.  I  
>> create a view that joins that table
>> to another table on the PKID.  The second table has a set of  
>> records which I need to delete out of
>> the first table, then append into the first table.  IOW the  
>> matching records in the first table have
>> have been updated and I need to delete them, then append in the  
>> updated records.
>>
>> I get an error message:
>>
>> "view or function MyFunction is not updatable because the  
>> modification affects multiple base tables."
>>
>> This is a simple view witj two tables, joined on the PKID, all  
>> fields selected in the table that
>> needs records updated (deleted), NO fields selected in the second  
>> table.
>>
>> What am I doing wrong?
>>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>



More information about the dba-SQLServer mailing list