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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 best way to input multiple records?

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
Go to Top of Page

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 enrol
2. these as a batch should insert with same reference number and treated as one enrol transaction
3. 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 this

right:
batch record
A 1
A 2
A 3
A 4
B 5

wrong:
batch record
A 1
A 2
B 3
A 4
A 5

any help on this?
Go to Top of Page

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2005-07-25 : 19:36:28
Why was it designed this way?
Go to Top of Page

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?
Go to Top of Page

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?

Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-07-25 : 23:09:34
i once did an enrollment system

i 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...
Go to Top of Page

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 system

i 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...

Go to Top of Page
   

- Advertisement -