Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
yipchunyu
Yak Posting Veteran
80 Posts |
Posted - 2005-07-25 : 04:48:12
|
| I'm writing an enrolment system. One requirement is that the user can enrol for multiple records per time.It's a ASP application which call COM+ components. What is the best way to do so?Pass array to a sp and use transaction inside the sp?Use VB code to lock the transaction and loop through the records?Any advice and reference is very much apprepiated. Thx |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2005-07-25 : 19:08:57
|
| I would create a transaction in the ASP app and execute the add records SP multiple times. It will hit the db many times, but it's more maintainable. You shouldn't need to 'lock' anything explicitly. Tim |
 |
|
|
yipchunyu
Yak Posting Veteran
80 Posts |
Posted - 2005-07-25 : 19:21:13
|
quote: Originally posted by timmy I would create a transaction in the ASP app and execute the add records SP multiple times. It will hit the db many times, but it's more maintainable. You shouldn't need to 'lock' anything explicitly. Tim
the problem is that the requirements:1. some people can help others to enrol2. these as a batch should insert with same reference number and treated as one enrol transaction3. it means that these records should insert first (even in the meant time, some records would like to insert)sorry for poor english. may be it's better express like thisright:batch recordA 1A 2A 3A 4B 5wrong:batch recordA 1A 2B 3A 4A 5any help on this? |
 |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2005-07-25 : 19:36:28
|
| Why was it designed this way? |
 |
|
|
yipchunyu
Yak Posting Veteran
80 Posts |
Posted - 2005-07-25 : 20:34:24
|
quote: Originally posted by timmy Why was it designed this way?
because the seat of each class is limited and they want to make it like first come, first serve (but allow certain people to help other to register the classes). Strange? |
 |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2005-07-25 : 20:58:48
|
| It is a bit. Surely there's a better way around it? |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-07-25 : 23:09:34
|
i once did an enrollment systemi believe this is a question of business logic and database design, not to mention security do not allow other users to enroll others, it will mess up your system and user security, not to mention other users dissatisfaction about the system coz other users were able to enroll them in schedules they didn't want to attend in the first place... HTH --------------------keeping it simple... |
 |
|
|
yipchunyu
Yak Posting Veteran
80 Posts |
Posted - 2005-07-26 : 01:28:41
|
it is one main requirement for me. The reason is that the manager can help his staff to enrol the course. so sad...quote: Originally posted by jen i once did an enrollment systemi believe this is a question of business logic and database design, not to mention security do not allow other users to enroll others, it will mess up your system and user security, not to mention other users dissatisfaction about the system coz other users were able to enroll them in schedules they didn't want to attend in the first place... HTH --------------------keeping it simple...
|
 |
|
|
|
|
|