I use the user-defined table parameter to track the keyed in values and pass it to a stored procedure. Syntax works fine. No problem with it.
Question:
- Does it creates multiple instances at the same time for individual sessions?
- Does it maintain different inserted data sets by session?
Requirement:
- User enters exam names and scores through a front end UI. It could be multiple exams and corresponding scores.
- This data should go through a stored procedure and will pick relevant information for all the exams and scores the student has entered.
- Multiple users may be connecting to the application at the same time, and entering their exam results. Entered information must be specific to that particular user.
Alternate: if the UDT is not supporting multi instance, I am planning to get the User input in concatenated values and split it by list inside the stored procedure
1条答案
按热度按时间hjzp0vay1#
If by User Defined Table you mean a Table Valued Parameter, then yes, it is not just per session but per request.
They are stored in
tempdb
similar to temp tables, under a random name, but as soon as the request finishes and it goes out of scope then it is dropped. You cannot access it from another scope. Their names begin with@
.If you mean temp tables then it depends. While they are stored under a random name, sometimes they can be shared.
#
.##
.