[dba-SQLServer] Why is my view not editable?

Mark Breen marklbreen at gmail.com
Thu Dec 2 07:26:48 CST 2010


Hello John,

Non-updatable recordsets are a PITA at times.

there are various tricks you can do to overcome it, but one that I found
useful is to use a nested select instead of join, eg

Select *
>From childtable
Where ParentId in
(select ParentId from Parent where FieldToFilterBy = @FieldToFilterBy)

this in effect, gives you a single table returned.  If you need data from
the parent, you may be able to use a different recordset for that other
data.

thanks

Mark


On 1 December 2010 13:16, jwcolby <jwcolby at colbyconsulting.com> wrote:

> I create a view of parent / child, joined on FK etc.  Filter to one
> specific parent using the
> parent's PKID.  I then try to edit a field in the child and it doesn't do
> anything, IOW it is locked
> for some reason.  I thought that simple views like this are supposed to be
> editable.
>
> --
> John W. Colby
> www.ColbyConsulting.com
> _______________________________________________
> 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