sql server 2005 - SQL - How can I temporarily protect the data in this table? -


I am populating a table that acts as a cache (this is necessary because the data is linked to the server Comes through and connecting via link is very expensive)

I have included the pseudo code below which hopefully what I am trying to do. I really do not know if there is a way to lock down a table like this, or I need to use the transaction, but here are the basics:

  1. Delete everything in the cachetable < / Li>
  2. Populate the cachetable
  3. Process the data in the cachetable for 10 seconds (it is important that other examples of this stored procedure do not remove the cachetable during processing!)
  4. Return processed form (CacheTable is free again)

Remove from CacheTable - If these errors are locked, then exit the stored procedure [[Lock CacheTable]] in CacheTable Insert Exec RemoteDB.dbo. [Sp_GrabRecords] @Start, @End, @Key Process Cached Data ... Select Processed Data [[Unlock Cacheable]]

How Can I Secure This Data Cachetable While Is it being processed?

Note: I am also looking for alternatives I tried to use a table variable, but it was very slow, probably because it was not a primary key, it is also not certain that the table variable is primary The key can be that I just know that the above method is very fast, but there is a problem with collision, obviously

isn 'that CacheTable is a temporary table, so stored Each instance of Yvidhi should allocate itself; So avoid the locking problem


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -