Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Different Status field problem
Message
From
04/06/2008 12:45:19
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01321643
Message ID:
01321652
Views:
12
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>Ok, I had an Approved (bit) field and I had a drop down (Awaiting Approval/Approved) + GridView. When I selected Awaiting Approval, I had checkboxes in my Grid, I could check multiple records, had a Save Approved person button what called SP. I also had ApprovedOn datetime field.
>
>Now, suppose I'm switching to Status field (character 1) to have multiple statuses.
>
>1. What kind of the interface would be good for the user?
>
>2. Once the Person is Approved, the status can not change (since Approving a person creates records in other tables). I guess this should be coded as an Update trigger on the table level...
>
>Thanks for ideas.

Hmm,
Aren't the interface is question for FrontEnd forum?
About trigger, no need of it IF you handle enable/disable status of the control where the user changes the status.
If you disable that control the the user can't change the status. BUT if someone uses some developer tools as SSMS or EM the sure, you should have TRIGGER for this, something like:
CREATE TRIGGER NoDeleteAprroved
       OF yourtable
       FOR UPDATE, DELETE -- How about delete approved records?
AS
  BEGIN
     IF EXISTS(SELECT * FROM DELETED WHERE ApprovedOn IS NOT NULL) -- or any other value which you consider EMPTY() :-)
        BEGIN
             RAISERROR('There are some APPROVED records in your query!', 11, 1)
             ROLLBACK TRANSACTION
        END
  END
that is just on top off my head and not tested at all :-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform