SET STATISTICS TIME ON
This will cause SQL server to display time stats for each sql statement.
>Hi everybody,
>
>What is the good way of running some performance tests? How can I output time spent on selects to some log file and see, which indexes are used, etc.?
>
>In VFP it's possible to create a program like this:
>
>sys(3054,11)
>lnStartTime = seconds()
>for i=1 to 100
> lnStartTimePerSelect = seconds()
> select ...
> lnElapsedTime = seconds() -lnStartTimePerSelect
>next
>...
>
>
>I think, I want something similar on SQL Server, but I don't know, how to organize it. I also didn't add indexes so far, so I want to test performance first without indexes, then after added indexes. Also my test database has only 5000 recs, but real table would have 400000 recs. Can I still make some performance tests? Would the information be helpful?
>
>Thanks in advance.