Re: Rowcount from all tables in database
30/01/2007 4:48:44 PM
(Total replies: 1)
SysIndexes works when you put an index to a table.
Also, you need to update the statistics when ever you insert data into a table to get reflected in the index table.
You can use following query to get the row-count:
'SELECT COUNT(*) AS [RowCount] FROM ' + so.Name
so.xType = 'U'
Only issue is that you have to run this in the SQL Query Analyser to run the output.
Let me know if this solves your problem.
Re: Slide deck and discussion re July 07 meeting - Understanding Execution Plans (Greg Linwood)
18/07/2007 10:05:34 AM
(Total replies: 0)
I had a query where I fine-tuned the query in the Query Analyser and it took 3mins to run, but after I moved the code to SP and the fine-tuning didn't work (it took more than an hour to run).
In ran the profiler with Execution Plan event on and found that the hints I gave is not used once inside the sp.
This particular select statement is one of many statements that populate a temp table inside the sp.
Do you have any idea as to why this is happening?
I got around this ...