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 Administration (2000)
 Determine if a table has finished loading

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-10-14 : 08:36:42
barb writes "Version - sqlserver2000 sp3 on w2k

How does query optimizer handle a batch that is loading a table and running a report on the table?
Example - Procedure A calls procedure B that builds tables with indexes. Procedure B then exports a file and runs a report. Procedure A updates a job contrl table.
But there is a problem if the process of building the tables and indexes take too long (we could be talking about a *lot* of data here). The job table is updated but the export and report process does not happen because there is a lock on the table (lock needs to stay).
My sol so far is to update the job table in proc b after the indexes have run then run the export and report in proc a only if the job table is updated appropriately. the process runs frequently so anything still loading could be captured in the next round. My question is whether this will work? Will query optimizer update the job table first- before the indexes have finished? If so is there a good way to determine if the table loading and index job is complete?
(apologies, if this seemed long winded)

thank you so much"

X002548
Not Just a Number

15586 Posts

Posted - 2003-10-14 : 09:49:29
If this is running as stored procedure calls...all of the calls will wait until each step is completed...no independant threads...

I thought xp_cmdshell was (and I guess it is) but the calling sproc still waits for the call to be completed...

So...are these jobs running independantly?

Any sample code?



Brett

8-)
Go to Top of Page
   

- Advertisement -