Learn how to share a work table among multiple users for reporting tools like Crystal Reports, and discover effective data locking strategies using timestamps.
This article explains how to share a work table across multiple users and addresses locking strategies.
If, for example, you have to use reporting software like Crystal Reports, you sometimes need a working table to display results because Crystal will not read data definitions from a temporary table. But how do you share this table with multiple users without problems?
My solution was to add a report ID field. Each user running the report adds their own unique report ID and deletes all their records once the report is produced. All of this can be accomplished within a stored procedure linked to the report.
There is also another issue that arises when updating data. If you use SQL's default locking mechanism, you can read data that is currently being changed.
If you add a timestamp to your table, you can retrieve that column and ensure the data you are reading is up to date. All you have to do is compare the timestamp you inserted with the one you are reading. If they are the same, the data is accurate. If they are not, the data you are reading has been updated.
Update a Work Table Across Multiple Users
Learn how to share a work table among multiple users for reporting tools like Crystal Reports, and discover effective data locking strategies using timestamps.
This article explains how to share a work table across multiple users and addresses locking strategies.
If, for example, you have to use reporting software like Crystal Reports, you sometimes need a working table to display results because Crystal will not read data definitions from a temporary table. But how do you share this table with multiple users without problems?
My solution was to add a report ID field. Each user running the report adds their own unique report ID and deletes all their records once the report is produced. All of this can be accomplished within a stored procedure linked to the report.
There is also another issue that arises when updating data. If you use SQL's default locking mechanism, you can read data that is currently being changed.
If you add a timestamp to your table, you can retrieve that column and ensure the data you are reading is up to date. All you have to do is compare the timestamp you inserted with the one you are reading. If they are the same, the data is accurate. If they are not, the data you are reading has been updated.
Update a Work Table Across Multiple Users
By Howtodotips
Learn how to share a work table among multiple users for reporting tools like Crystal Reports, and discover effective data locking strategies using timestamps.