1

I have a windows service application that imports a CSV file. During the import process, the application runs a series of queries to the database. During stress testing, we tried importing a CSV with 40k records. That means at least 40k queries to the database. Normally the queries run fine but there are times that the application would randomly get an error from the db " Invalid object name 'TableName' ".

Any idea what could be causing the error? I know that it's not in the query since the query executes successfully most of the time.

This is the actual query that I captured using the Text Visualizer. This runs successfully in SSMS

SELECT c.MemberInternalKey, 
       c.ClubCardId, 
       c.RestrictionId, 
       c.ExpirationDate, 
       m.ExternalMemberKey, 
       m.BuyingUnitInternalKey, 
       b.ExternalBuyingUnit,  
       b.PostalCode, 
       b.Country, 
       b.Street1, 
       b.City, 
       b.HomePhone, 
       b.EmailAddress, 
       b.SendEmail, 
       m2.ExternalMemberKey as OldestExternalMemberKey, 
       m2.BirthDate, 
       m2.MobilePhoneNumber, 
       m2.WorkPhoneNumber, 
       m2.Gender 
FROM dbo.CRM_Clubcard c 
INNER JOIN dbo.CRM_Member m ON c.MemberInternalKey = m.MemberInternalKey 
INNER JOIN dbo.CRM_BuyingUnit b ON m.BuyingUnitInternalKey = b.BuyingUnitInternalKey 
INNER JOIN dbo.CRM_Member m2 ON m2.BuyingUnitInternalKey = m.BuyingUnitInternalKey 
WHERE c.ClubInternalKey = 2 
AND c.ClubCardId  = '1004303119' 
AND m2.IsMainMember = 1
16
  • What is the timeframe in which these 40k queries are executed? Commented Sep 1, 2016 at 6:45
  • Hi Daniel. It's about 2 minutes Commented Sep 1, 2016 at 6:46
  • Are you getting error each time when you try to import same 40k records, or only sometimes? Commented Sep 1, 2016 at 6:49
  • Only sometimes. When we tried importing the same 40k records again, We did not get any error. It just happens randomly Commented Sep 1, 2016 at 6:51
  • Did you try to run Profiler and see what's happening? Commented Sep 1, 2016 at 6:52

1 Answer 1

0

I have fixed the issue by re-initializing the connection string for every method call / query to the database. Running the profiler was a big help.

Sign up to request clarification or add additional context in comments.

1 Comment

Any idea what the root cause of the issue was.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.