B
bthumber
I need to delete a record form a database, but I don't want to lose that
record. I was told I could set a flag, so the question is how do you do that?
record. I was told I could set a flag, so the question is how do you do that?
I need to delete a record form a database, but I don't want to lose
that record. I was told I could set a flag, so the question is how do
you do that?
I should have followed up, but the "History" idea is alot cleaner than
the SoftDelete flag/column.
SNIPPED
the table, //
Don't some RDBMS provide this functionality natively...?
IIRC, deleting a record in dBase / FoxPro doesn't actually delete it,
but just marks it internally as unavailable. Isn't there a PACK
command that you run to delete these "deleted" records permanently and
reclaim their disk space...?
//Some times you have hte requirement to list all itesm in
Agreed.
One workaround option for this is a view that combines the data.
GO
IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS WHERE
TABLE_NAME = 'vwEmployeeMerged')
begin
DROP VIEW dbo.vwEmployeeMerged
end
GO
CREATE VIEW dbo.vwEmployeeMerged
AS
select
EmployeeUUID, SSN
from
dbo.Employee
UNION ALL
select
EmployeeArchiveUUID as EmployeeUUID, SSN
from
dbo.EmployeeArchive
GO
print 'Put Back : vwEmployeeMerged'
GRANT SELECT ON dbo.vwEmployeeMerged TO public
GO
Nothing wrong with that... ;-)
You been on my webcam again...?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.