Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Different Status field problem
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01321643
Message ID:
01321654
Views:
10
>>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 :-)

Yes, I was thinking along the same lines for the trigger.

For now I decided to leave the page and table as is and concentrate on some other tasks. I need to create the interface prototype in my head first and the fact that I already have something working is not helping...
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform