R
Randall Arnold
Thanks to a former dba who didn't set up cascading deletes between joined
tables, I have inherited a master table with 395 orphaned records. The
orphan state can only be determined when the master table is joined to the
table on the many side. I need to delete these 395 records and then enforce
referential integrity, but my delete query produces an error whether it's
run in Access (2003) or SQL Server (2005). The error states that the View
"is not updateable because the modification affects multiple base tables".
Odd thing is, I've been able to do this in similar situations.
Here is my join query:
SELECT dbo.InternalAudit.InternalAuditID,
dbo.InternalAuditFails.InternalAuditFailID
FROM dbo.InternalAudit LEFT OUTER JOIN
dbo.InternalAuditFails ON
dbo.InternalAudit.InternalAuditID = dbo.InternalAuditFails.InternalAuditID
WHERE (dbo.InternalAudit.PassAudit = 0)
That pulls in the good and bad records. My DELETE stored procedure is as
follows:
DELETE FROM dev.View0
WHERE (InternalAuditFailID IS NULL)
Seems pretty straight-forward to me, but no go.
Any ideas?
Thanks,
Randall Arnold
tables, I have inherited a master table with 395 orphaned records. The
orphan state can only be determined when the master table is joined to the
table on the many side. I need to delete these 395 records and then enforce
referential integrity, but my delete query produces an error whether it's
run in Access (2003) or SQL Server (2005). The error states that the View
"is not updateable because the modification affects multiple base tables".
Odd thing is, I've been able to do this in similar situations.
Here is my join query:
SELECT dbo.InternalAudit.InternalAuditID,
dbo.InternalAuditFails.InternalAuditFailID
FROM dbo.InternalAudit LEFT OUTER JOIN
dbo.InternalAuditFails ON
dbo.InternalAudit.InternalAuditID = dbo.InternalAuditFails.InternalAuditID
WHERE (dbo.InternalAudit.PassAudit = 0)
That pulls in the good and bad records. My DELETE stored procedure is as
follows:
DELETE FROM dev.View0
WHERE (InternalAuditFailID IS NULL)
Seems pretty straight-forward to me, but no go.
Any ideas?
Thanks,
Randall Arnold