45
Views
2
Comments
Solved
Question on temp tables in a multi-user environment
Question
Application Type
Reactive
Service Studio Version
11.54.62 (Build 63330)

I'm trying to determine best practices...

I have a situation where the user is entering data in a form with a popup for adding multiple follow up dates. I don't want to save the dates in the follow up dates table until the main form's data is saved. I know I can have the popup based on a list as opposed to a temp table (table I use only during this operation). Is the list preferable?

More to the point, If I do use a temp table, is it unique to the user's session or will other users on the same form also see data from the other user session temp table? The table is in the same module as the form, not the core data module.

I have another form that is using a temp table that is thousands of records long.  It's created before a form is opened and then used in the aggregate for that form. Same questions apply. Will the user sessions see the same data or does each have it's own data?

Thanks in advance.


2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
Solution

Hi,

If you created and entity in a module, it is a permanent table in the database, records are not tight to a particular session or user unless you would store a session number or User id along with the records, and make sure to always filter on those attributes in an aggregate or advanced SQL.

Or are you creating the temporary table with the following syntax?  #  (see https://www.mssqltips.com/sqlservertip/1556/differences-between-sql-server-temporary-tables-and-table-variables/)

Regarding your question temporary table versus list, there is nothing wrong with list, it is easy no advanced SQL required, and you can easily persist the list date once the popup is closed.

-- Daniel

2024-09-26 10-22-06
Siva D
Solution

Hi @Jeff Kest ,

     For your scenario where you are adding multiple follow-up dates and don’t want to save them permanently until the main form is saved, using a local list within the screen context (a variable or a local list) is preferable. This approach ensures that the data is temporary and unique to the user’s session without the complexity of managing session-specific temp tables. 

If you use temp tables, ensure they include session-specific identifiers to isolate data per user session. 

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
Solution

Hi,

If you created and entity in a module, it is a permanent table in the database, records are not tight to a particular session or user unless you would store a session number or User id along with the records, and make sure to always filter on those attributes in an aggregate or advanced SQL.

Or are you creating the temporary table with the following syntax?  #  (see https://www.mssqltips.com/sqlservertip/1556/differences-between-sql-server-temporary-tables-and-table-variables/)

Regarding your question temporary table versus list, there is nothing wrong with list, it is easy no advanced SQL required, and you can easily persist the list date once the popup is closed.

-- Daniel

2024-09-26 10-22-06
Siva D
Solution

Hi @Jeff Kest ,

     For your scenario where you are adding multiple follow-up dates and don’t want to save them permanently until the main form is saved, using a local list within the screen context (a variable or a local list) is preferable. This approach ensures that the data is temporary and unique to the user’s session without the complexity of managing session-specific temp tables. 

If you use temp tables, ensure they include session-specific identifiers to isolate data per user session. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.