tags:

views:

45

answers:

3

Ideally I would have a "isActive" field in the table to indicate if a record is active, but it would involve changes in multiple stored procedures to make the field do what it is meant to do.

I came up with a dirty trick, and kind of tempted to carry it out. Since the result set is generated by a few joins, I was thinking of slightly changing the foreign key in one of the tables by appending an "*", "x", or whatever symbol that doesn't usually end up in a key.

Is there anything I should be afraid of?

+3  A: 

One way to have a "not active" state without changing all the other stored procedures is to MOVE the record to a "non active" table while the record is not active.

BoltBait
i actually like this idea :) but then you would end up having a lot of mirror tables for that purpose. It's slick nevertheless.
Haoest
+1  A: 

Is there anything I should be afraid of?

Is having an inconsistent data with discrepancy with unreadable data caused by appending special character an issue?

If this issue is to crop up some later time, I think it is time to refactor your stored procedures or tables.

Sung Meister
+1  A: 

Do you mean to go into the database and manually add a character to a particular row to disable a single Customer or whatever?

What about the joins - can you add ...AND CustomerId NOT IN ( 1234, ...) to the WHERE clause temporarily?

I don't think you should start messing with data like that, even if referential integrity allows you to.

MikeW