December 29, 2009 at 12:38 pm
I'm experiencing a weird issue where there is a 30-60 second delay in records being added to a table after the proc that does the insert has finished. I've attached the procedures that are being run for reference, but I don't see how this would pertain to what is happening.
dbo.Proc1: Drops table. Creates table (different schema). Inserts records into new table. Updates two other tables based on values in this table.
dbo.Proc2: selects data from the table into some temp tables, returns some of the data.
When these two procs are run concurrently, Proc2 returns an empty result set.
When the second proc is run in a loop with a waitfor delay '00:00:10' preceeding it, and repeating 6 times (for one minute), the expected result set will occur between the 4th and 6th running of the proc.
Note that the updates going on in the first proc are occurring based on the data being inserted into the table.
I have tried:
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED before running any of the procedures.
SET IMPLICIT TRANSACTIONS ON/OFF (both tried) before running any of the procedures.
So, what else is there that would cause a delay in a record being posted to a table where other procs can see it?
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
December 29, 2009 at 12:50 pm
The script errors out because there is no ccim_users schema. I removed that and the procedures compiled, but won't run because the tables are missing. Can you provide table layouts and data? How many records are in each table? I also noticed that there is no transaction being created as well as no error handling
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
December 30, 2009 at 8:10 am
Are there any triggers?
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
December 30, 2009 at 9:08 am
Jack Corbett (12/30/2009)
Are there any triggers?
Spot on... another problem may be an explicitly declared transaction where all this stuff get's stacked up in the log and then get's "released" when the final COMMIT is executed. As Jack suggests, triggers on the table would increase this problem but those aren't the only things... Computed columns with PERSIST, Indexed Views, and Indexes (especially the clustered index) with very low cardinality for the first column in the index.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply