Stored procedure timed out after importing dta
Posted on 2011-10-03
I really hope someone can help me.
I have a stored procedure in SQL server 2005 that imports data from a database on a different server. It can import about 10000 or more records at a time.
My desk top app calls this stored procedure giving it the date range to select the data. It works fine.
After it imports data, user can open a form to display this data on a grid. I call another stored procedure to get this data. but it times out. If I quit the app, goto sql server,
run DBCC DBREINDEX(Edits_data, '', 80)
UPDATE STATISTICS Edits_data
WITH FULLSCAN, NORECOMPUTE
and then go back to the application, it works fine.
Does that mean, my index and Statistics are not being updated? I have set "Auto Update Statistics and Auto update index True.
User can run a few batches at a time and import may be 30,000 records or more! I have one clustered index on primary key(this is an nvarchar field) and 3 other non-clustered index.
How do I solve this problem? It is stopping me from releasing the application. Any help will be appreciated.